Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

halp mergesort on linked list (java)

Name: Anonymous 2007-10-15 21:52

I have 2 linklists containing objects (all are numbers) already sorted.  how do I go about merging the 2 lists into 1 sorted linked list??

Name: Anonymous 2007-10-15 22:08

1. take first element of both lists
2. pick smallest (or either if equal), remove from list and append to result list
3. repeat until one list is empty
4. append remaining items to result list

if you can't figure this shit out on your own, programming probably isn't for you

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List