1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

<br /> for(currentNum = low; currentNum <= high; currentNum++){<br /> for(index = 0; index <= 255; index++ ){<br /> if(freq[index]==currentNum && size == 0){<br /> TreeNode* node = new TreeNode(index, freq[index]);<br /> front = new List(node);<br /> current = front;<br /> size++ ;<br /> }<br /> else{<br /> if(freq[index]==currentNum){<br /> TreeNode* node = new TreeNode(index, freq[index]);<br /> cout << node>getChar() << node>getFreq() << "n";<br /> current>Next = new List(node);<br /> current = current>Next;<br /> }<br /> }<br /> }<br /> }<br /> return front;<br /> } 
Ive been trying to construct a linked list as shown above, for some reason it only adds nodes till like the fourth node and after that stops adding, Ive debugged and see that it gets down to actually creating the node but for some reason it doesnt add to the List , help would be appreciated.