breaking up some tuples

This is a rather specific problem and somewhat contrived. Found on careercup.com. There is an array of 3-tuple, in the form of (a, 1, 5). The first element in the tuple is the id, the second and third elements are both integers, and the third is always larger than…

Read full post

heapsort

Heap Sort In part 4 of MIT 6006 goes into heap data structures and heap sort. Heap sort runs in O(nlog n) time provided the array is already a heap and displays the heap invariant: that each parent node is greater than or equal to both its children. The…

Read full post