NodeList.insertionSort

Performs an insertion sort on the node list. In general, insertion sort is very efficient with short lists and with lists that are mostly sorted, but is inefficient with large lists that are randomly ordered.

<p>The sort function takes two nodes and returns a Number.</p>

<p><code>function sortFunction( node1 : MockNode, node2 : MockNode ) : Number</code></p>

<p>If the returned number is less than zero, the first node should be before the second. If it is greater than zero the second node should be before the first. If it is zero the order of the nodes doesn't matter and the original order will be retained.</p>

<p>This insertion sort implementation runs in place so no objects are created during the sort.</p>

class NodeList
void
insertionSort

Meta