CS 331 Design and Analysis of Algorithms

The simple way is to let the heap sort finishes its job first, and then we build a routine scan the array to remove duplicates. The scan running time is of order(n) where n is the size of the array. The more efficient way is to eliminate the duplicates during the “delete step” of the root by moving it to the bottom right node of the tree. ................
................