iv Contents
8.4. Improvements to the Basic Algorithm .................................................................... 403
8.5. Bottom-Up Mergesort ..........................................................................................406
8.6. Performance Characteristics of Mergesort ...............................................................412
8.7. Linked-List Implementations of Mergesort ..............................................................415
8.8. Recursion Revisited .............................................................................................419
Chapter Nine. Priority Queues and Heapsort ............................................................. 421
9.1. Elementary Implementations ................................................................................ 425
9.2. Heap Data Structure ............................................................................................430
9.3. Algorithms on Heaps............................................................................................433
9.4. Heapsort ............................................................................................................443
9.5. Priority-Queue ADT..............................................................................................452
9.6. Priority Queues for Index Items ............................................................................459
9.7. Binomial Queues ................................................................................................. 464
Chapter Ten. Radix Sorting ....................................................................................... 478
10.1. Bits, Bytes, and Words .......................................................................................480
10.2. Binary Quicksort................................................................................................484
10.3. MSD Radix Sort ................................................................................................. 490
10.4. Three-Way Radix Quicksort ................................................................................. 500
10.5. LSD Radix Sort.................................................................................................. 505
10.6. Performance Characteristics of Radix Sorts ...........................................................510
10.7. Sublinear-Time Sorts..........................................................................................514
Chapter Eleven. Special-Purpose Sorting Methods .................................................... 520
11.1. Batcher's Odd–Even Mergesort............................................................................522
11.2. Sorting Networks...............................................................................................530
11.3. External Sorting ................................................................................................541
11.4. Sort–Merge Implementations ..............................................................................547
11.5. Parallel Sort–Merge............................................................................................555
References for Part Three............................................................................................559
Part Four: Searching .................................................................................................... 561
Chapter Twelve. Symbol Tables and Binary Search Trees.......................................... 561
12.1. Symbol-Table Abstract Data Type.........................................................................563
12.2. Key-Indexed Search...........................................................................................569
12.3. Sequential Search..............................................................................................573
12.4. Binary Search ................................................................................................... 581
12.5. Binary Search Trees (BSTs).................................................................................588
12.6. Performance Characteristics of BSTs .................................................................... 596
12.7. Index Implementations with Symbol Tables ..........................................................601
12.8. Insertion at the Root in BSTs............................................................................... 606
12.9. BST Implementations of Other ADT Functions .......................................................614
Chapter Thirteen. Balanced Trees ............................................................................. 625
13.1. Randomized BSTs ..............................................................................................629
13.2. Splay BSTs ....................................................................................................... 638