Swipe to navigate through the chapters of this book
This chapter explores two very practical problems: searching and sorting. We consider Linear Search and (two versions of) Binary Search. Binary trees are used to describe the search process. Binary search is much, much better but requires sorted input. We give examples of several sorting strategies: selection sorts, exchange sorts, and partition sorts. A binary tree produces a lower bound on the number of key comparisons that must be done in a worst case and in the average case.
This chapter ends with timing comparisons and a relation between the time and number of key comparisons that anticipates the notion of order of complexity.
Please log in to get access to this content
- Searching and Sorting
- Springer London
- Sequence number
- Chapter number