Unformatted text preview: 2 ) worst case time complexity. The average case has complexity O(n log n) for practically all distributions. The computational overhead is small as only moving to the left of pivot is costly, moving to the right costs very little (or vice versa dependently if we sort ascending or descending). Hence we have huge time savings in roughly half cases on average. 4. a. Show the heap (complete partially ordered tree) that results if the integers 6,4,7,3,1,9 are inserted into an empty heap. What is the result if DELETEMIN is then applied? b. Show the binary search tree that results if the integers 6,4,7,3,1,9 are inserted into an empty tree. What is the result if DELETEMIN is then applied? a) 1 / \ 3 7 / \ / 6 4 9 After DELETEMIN: 3 / \ 4 7 / \ 6 9...
View Full Document
This note was uploaded on 12/10/2009 for the course CAS 2c03 taught by Professor Janicki during the Spring '03 term at McMaster University.
- Spring '03