Results 1 to 1 of 1
  1. #1
    johnnychwu is offline Member
    Join Date
    Nov 2011
    Posts
    1
    Rep Power
    0

    Default 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!
    Last edited by johnnychwu; 11-14-2011 at 04:05 AM.

Similar Threads

  1. treeset compare
    By samaravadhi in forum New To Java
    Replies: 6
    Last Post: 09-07-2011, 04:59 PM
  2. TreeSet weirdness
    By Bulska in forum New To Java
    Replies: 3
    Last Post: 03-18-2011, 04:29 PM
  3. Please Help - TreeSet
    By Riftara in forum New To Java
    Replies: 1
    Last Post: 10-21-2010, 09:33 PM
  4. TreeSet Demonstration
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-15-2008, 08:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •