Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


Share this Page URL
Help

Chapter 8. Sorting > 8.1 Sorting - Pg. 432

432 Chapter 8: Sorting Explain the characteristics of a binary tree that make it a heap, and understand the algo- rithm that transforms a binary tree into a heap. Understand the topic of recursion more fully by examining the recursive parts of the Merge Sort and Quicksort algorithms. 8.1 Sorting Sorting is the process of ordering a set of items. The two most common orderings are ascending order and descending order. In the context of data structures, it is the process of arranging nodes in an order based on the contents of one of the fields in the nodes. For example, the nodes that comprise a collection of telephone listings are usually sorted in ascending order based on the con- tents of the name field, while the results of a weight lifting contest would possibly be sorted in descending order based on the contents of the maximum weight lifted field. Most often, nodes are sorted for one of two reasons: 1. To produce sorted output listings.