Results 1 to 2 of 2
  1. #1
    koolaqua16 is offline Member
    Join Date
    Aug 2009
    Posts
    1
    Rep Power
    0

    Smile Sorted LinkList problem

    I need to write a Recursive function L.insert(item) which inserts integer item it its correct position in L.So,if L is initially empty,the pseudocode below :

    inputs = {10,20,-8,7,12}

    Create an empty List

    while(there is input)
    {
    Read item
    L.insert(item)
    }

    should create sorted list as follows

    L = {-8,7,10,12,20 }

    I don' know how to sort a Linked list.

    Please can anybody help me out

  2. #2
    mtyoung is offline Senior Member
    Join Date
    Dec 2008
    Location
    Hong Kong
    Posts
    473
    Rep Power
    6

Similar Threads

  1. Replies: 7
    Last Post: 04-28-2008, 04:28 AM
  2. Replies: 8
    Last Post: 04-22-2008, 03:21 AM
  3. How to create a Sorted List in Java
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-16-2008, 10:31 PM
  4. Replies: 0
    Last Post: 04-14-2008, 08:39 PM
  5. My doublyLinked list does not get sorted
    By hasani6leap in forum New To Java
    Replies: 0
    Last Post: 01-06-2008, 03:09 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
  •