This preview shows page 1. Sign up to view the full content.
Unformatted text preview: introducing many standard design techniques and analysis tools. Here is how we formally dene the sorting problem : Input: A sequence of n numbers a 1 , a 2 ,... , a n . Output: A permutation (reordering) a 1 , a 2 , ... , a n of the input sequence such that a 1 a 2 a n . For example, given the input sequence 31 , 41 , 59 , 26 , 41 , 58 , a sorting algorithm returns as output the sequence 26 , 31 , 41 , 41 , 58 , 59 . Such an input sequence is called an instance of the sorting problem. In general, an instance of a problem consists of the input (satisfying whatever constraints are imposed in the problem statement) needed to compute a solution to the problem. Sorting is a fundamental operation in computer science (many programs use it as an intermediate step), and as a result a large number of good sorting algorithms...
View Full Document
This document was uploaded on 11/22/2010.
- Fall '09