Utility function that allocates a new Node
function newNode ( data ) { let node = new Node ( data ) ; return ( node ) ; } function bitCount ( x ) { let setBits = 0 ; while ( x != 0 ) { x = x & ( x - 1 ) ; setBits ++ ; } return setBits ; }