Unformatted text preview: introducing many standard design techniques and analysis tools. Here is how we formally deﬁne 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
 Fall '09
 Computer Science, Algorithms, input sequence

Click to edit the document details