The Art of Computer Programming, Volume 3: Sorting and Searching (2nd Edition)

The Art of Computer Programming, Volume 3: Sorting and Searching (2nd Edition)

Donald E. Knuth

Language: English

Pages: 1

ISBN: 0201896850

Format: PDF / Kindle (mobi) / ePub

The first revision of this third volume is the most comprehensive survey of classical computer techniques for sorting and searching. It extends the treatment of data structures in Volume 1 to consider both large and small databases and internal and external memories. The book contains a selection of carefully checked computer methods, with a quantitative analysis of their efficiency. Outstanding features of the second edition include a revised section on optimum sorting and new discussions of the theory of permutations and of universal hashing.


Calendrical Calculations (3rd Edition)

Start Concurrent: An Introduction to Problem Solving in Java with a Focus on Concurrency (2014 Edition)

Principles of Digital Image Processing, Volume 3: Advanced Methods (Undergraduate Topics in Computer Science)




















bj), (ak, bk) forms a triangle. a) Prove that the average number of comparisons made by the restricted uniform sorting algorithm is b) Use the results of (a) and exercise 64 to determine the average number of irredundant comparisons performed by quicksort. c) The following pair sequence is inspired by (but not equivalent to) merge sorting: (1, 2)(3, 4)(5, 6) . . . (1, 3)(1, 4)(2, 3)(2, 4)(5, 7) . . . (1, 5)(1, 6)(1, 7)(1, 8)(2, 5) . . . Does the uniform method based on this sequence do more

may take ॠ艂 蝶 ॠ, since every phase is usually followed by a rewind of about the same length as the previous merge. From Table 5.4.2舑1 we get the values ॅ 蝶 0.795, ॆ 蝶 0.864 蜢 2, in the case of six tapes. (We subtract 2 because the table entry includes the initial and final passes as well as the intermediate ones.) The time for rewinding the input tape after the initial distribution, namely ॡNC३i। + ै, should be added to (9). Example 3. Read-forward cascade merge. Table 5.4.3舑1 gives the values ॅ

significance of other rating numbers becomes clear. For example, a rating of 17 would indicate an exercise that is a bit simpler than average. Problems with a rating of 50 that are subsequently solved by some reader may appear with a 40 rating in later editions of the book, and in the errata posted on the Internet (see page iv). The remainder of the rating number divided by 5 indicates the amount of detailed work required. Thus, an exercise rated 24 may take longer to solve than an exercise that

nonempty subtree. To delete a node, we should replace it by one of its terminal descendants, for example by searching to the right whenever possible. 12. Insert three random numbers ॅ, ॆ, े between 0 and 1 into an initially empty tree; then delete ॅ with probability p, ॆ with probability q, े with probability r, using the algorithm suggested in the previous exercise. The tree is obtained with probability p + q + r, and this is only if p = 0. 13. Add a KEY field to each node, and compare K with

average. Thus no procedure that finds the second largest of six elements can be optimum in both the minimax and the minimean senses simultaneously. Let denote the minimum average number of comparisons needed to find the tth largest of n elements. Table 2 shows the exact values for small n, as computed by D. Hoey. Table 2 Minimum Average Comparisons for Selection R. W. Floyd discovered in 1970 that the median of n elements can be found with only comparisons, on the average. He and R. L. Rivest

Download sample