Tutorial 3 - Linked List

Q1b/c

The mysteryMethod is equivalent to a single pass of the Bubble Sort algorithm, it “bubbles” the largest element to the end of the list. The boolean value returned by the method indicates whether any swaps too place. If there are no swaps, then the list is already sorted and mysteryMethod returns false.

The mysteriousMethod is basically Bubble Sort on a linked list, it calls the mysteryMethod until the list is sorted, i.e. until mysteryMethod returns false.

 
cs1102/tut3.txt · Last modified: 2009/02/14 13:59 by melvin
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki