Thread: sorting a linklist

  1. #1
    Registered User
    Join Date
    Oct 2003
    Posts
    3

    Question sorting a linklist

    i'm havinng trouble getting my sort function to work - it should bubble sort a link list but i keep getting run time errors
    any help would be appreciated

  2. #2
    Registered User
    Join Date
    Aug 2003
    Posts
    3
    The best sorting algorithm for the link lists would be the selection sort method. Try using that one. And if you are unable to get results reply and I will try to deliver the code.

  3. #3
    Registered User
    Join Date
    Oct 2003
    Posts
    3
    thanks for your reply Kharea -the prob though is that as a beginner the bubble sort is the only one i knew(or thought i did)
    how to manipulate so if you could send me the code for the select sort i'd be thankful ....btw how's the next side of the world?.i'm in Jamaica

  4. #4
    Been here, done that.
    Join Date
    May 2003
    Posts
    1,164
    A bubble sort will work fine.

    Have you tried to figure out where the runtime error occurs? What line?

    Have you run the code with the debugger?

    Add print statements to pinpoint the problem line.
    Definition: Politics -- Latin, from
    poly meaning many and
    tics meaning blood sucking parasites
    -- Tom Smothers

  5. #5
    Registered User
    Join Date
    Oct 2003
    Posts
    3
    K ...just to let you know that i figured out the slection sort for the link list - wasnt as difficult as i thought..so you dont havre to send the code ..thanks for *ing me in that direction ...

    Walt ....i wouldnt mind taking another look at the B.sort implementation ...but it frustrated the heck out of me - so i'll leave it alone for now

    thanks peeps.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help with linked list sorting function
    By Jaggid1x in forum C Programming
    Replies: 6
    Last Post: 06-02-2009, 02:14 AM
  2. sorting structure members using pointers
    By robstr12 in forum C Programming
    Replies: 5
    Last Post: 07-25-2005, 05:50 PM
  3. LinkList Sorting in C
    By simly01 in forum C Programming
    Replies: 3
    Last Post: 11-25-2002, 01:21 PM
  4. Quick LinkList Help!!adding at the End
    By simly01 in forum C++ Programming
    Replies: 13
    Last Post: 07-28-2002, 07:19 AM
  5. Still Needing Help : selection sorting
    By Unregistered in forum C Programming
    Replies: 6
    Last Post: 10-14-2001, 08:41 PM