TreeSet & Displaying
Hello fellow Java coders,
So I have a TreeSet with 5000000 phone number strings and I want to display the first, middle, and last strings. How can I go about doing that? I tried using a counter and iterator but the display doesn't seem to be right because the output of the last phone number should be the largest and it never is.
this is the conditional statement in my while (tree.hasNext()) loop that I'm not able to figure out what the problem is.
if (cnt = 1 || ... ) System.out.print tree.next(), repeat for 2500000 and 5000000.
Help very much appreciated!