Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Ordered Linked List

  1. #1
    Junior Member
    Join Date
    May 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Ordered Linked List

    Hi,

    Im trying to read items from a textfile and turn them into objects and then store them in to a linked list but it must be in order by the description of the object. So how would i go about doing this, i know i need to add the first item, then compare the next item with the first and the third with the first two and so on but not sure exactly how to do it.

    Thanks.


  2. #2
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: Ordered Linked List

    Quote Originally Posted by LemmyWinks View Post
    i know i need to add the first item
    Quote Originally Posted by LemmyWinks View Post
    then compare the next item with the first
    Quote Originally Posted by LemmyWinks View Post
    and the third with the first two and so on
    In your own words, there is a very rough outline of what is to happen. Break each of those down into finer steps.
    For example, your first part, adding the first item, what is required?
    Well for one you would have to be able to take input. (probably more steps involved for that)
    Then you need a place to store the input.
    etc etc

    Refine each step in your outline until it starts looking like code.

Similar Threads

  1. linked list
    By javasohard in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 18th, 2011, 02:22 AM
  2. Linked list Schminked list help with Nodes Please
    By Bially in forum Collections and Generics
    Replies: 1
    Last Post: September 29th, 2011, 03:20 PM
  3. Linked List Help
    By BuhRock in forum Collections and Generics
    Replies: 3
    Last Post: September 26th, 2011, 08:43 AM
  4. linked list help
    By tjoney in forum What's Wrong With My Code?
    Replies: 6
    Last Post: March 3rd, 2011, 06:54 PM
  5. Help with linked list
    By joecool594 in forum Collections and Generics
    Replies: 3
    Last Post: November 28th, 2010, 12:33 PM