
My existing code currently all assumes an intrusive list, so it isn't as usefully templated as yours. Because linked lists are dynamic data structures, whose memory can be stored anywhere, non contiguously, just as long as each node has a pointer referencing. What symptoms are you seeing when using the recursive merge? Do you get a stack overflow again, or does it crash, or not sort correctly, or does the list lose some nodes or.? Note that the stability test isn't important, as it will sort just fine either way.

I couldn't see anything wrong with you recursive merge so I threw it into my own sorting program which contains a basic testbed and initially it just failed the stability test, but after reversing the comparison and swapping the if and else clauses it passed all tests.
Linked list stack overflow update#
Make sure you update those other sites to say what has been solved. Incidentally, posting on many forums is often frowned upon because some people might go to the effort of solving your problem only to find that it has already been answered elsewhere. If you take a quick look at my website (link in signature), you might see why I knew enough to help. While(head_two->get_next() != NULL & head_one != NULL) Lets put the shellcode.bin file into the environment. While(head_one->get_next() != NULL & head_two != NULL) Like the buffer overflow, we will overflow the command line argument in notesearch with the address of the environment variable (which will be shellcode.bin) causing the shellcode program to execute, giving us root access to the system. Stack overflow is a software bug which occurs when a program tries to access more memory. Head_one->set_next(head_two->get_next()) The following article provides an outline for C++ stack overflow. Head_two->set_next(head_one->get_next())

Node* LinkedList::merge(Node* head_one, Node* head_two) Return merge(merge_sort(head_one), merge_sort(head_two))

While ((head_two != NULL) & (head_two->get_next() != NULL))
