Mastering Algorithms with C by Kyle Loudon This page contains errors corrected in the 6/00 reprint. Here's a key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem ?page-number?: reader question or request for clarification (xv) Updated the "How to Contact Us" section in the Preface to read: We have tested and verified the information in this book to the best of our ability, but you may find that features have changed (or even that we have made mistakes!). Please let us know about any errors you find, as well as your suggestions for future editions, by writing to: O'Reilly & Associates, Inc. 101 Morris Street Sebastopol, CA 95472 1-800-998-9938 (in the U.S. or Canada) 1-707-829-0515 (international/local) 1-707-829-0104 (FAX) You can also send us messages electronically. To be put on the mailing list or request a catalog, send email to: info@oreilly.com To ask technical questions or comment on the book, send email to: bookquestions@oreilly.com We have a web site for the book, where we'll list examples, errata, and any plans for future editions. You can access this page at: http://www.oreilly.com/catalog/masteralgoc/ For more information about this book and others, see the O'Reilly web site: http://www.oreilly.com <13> Beginning with the third to last line on the page, it did read: "Thus, it remains valid even after f returns...The parameter iptr... so that when f returns..." Now reads: "Thus, it remains valid even after g returns...The parameter iptr... so that when g returns..." {22} At the bottom of the page, the last line of code did read: retval = list_ins_next(... Now reads: retval = list_rem_next(... {34} The equation at the bottom of the page did read: T(n) = 1 if n = 0 2T(n/2) + n if n > 0 Now reads: T(n) = 1 if n = 2 2T(n/2) + n if n = 1, n > 2 {64} Line 5 from top did read: if (list_size(list) == 0) Now reads: if (list_size(list) == 1) <181> The definition for "Preorder traversal" has been changed to read: "In a preorder traversal for a given subtree, we first traverse its root, then to the left, and then to the right. As we explore subtrees to the left and right, we proceed in a similar manner using the left or right node as the root of the new subtree. The preorder traversal is a depth-first exploration, like that presented for graphs in Chapter 11, Graphs." <182> The definition for "Inorder traversal" has been changed to read: "In an inorder traversal for a given subtree, we first traverse to the left, then to the root, and then to the right. As we explore subtrees to the left and right, we proceed in a similar manner using the left or right node as the root of the new subtree." <182> The definition for "Postorder traversal" has been changed to read: "In a postorder traversal for a given subtree, we first traverse to the left, then to the right, and then to the root. As we explore subtrees to the left and right, we proceed in a similar manner using the left or right node as the root of the new subtree." {215} A line of code has been added at the end of the page to read: static void destroy_right(BisTree *tree, BiTreeNode *node); {219} In the function destroy_left, the calls did read: bitree_rem_left(tree, *position); bitree_rem_right(tree, *position); Now read: destroy_left(tree, *position); destroy_right(tree, *position); (304) In the second paragraph under the section on implementation and analysis, the third sentence did read: "Since the element at the left of the sorted set..." Now reads: "Since the element just to the right of the sorted set..." <325> The second sentence in the "Description" section did read: "The argument k specifies the maximum integer in data." Now reads: "The argument k specifies the maximum integer in data, plus 1." <325> The sentence in the "Complexity" section did read: "...the maximum integer in the unsorted set." Now reads: "...the maximum integer in the unsorted set, plus 1." <325> The first sentence in the last paragraph on the page did read: "...the largest integer being sorted." Now reads: "...the largest integer being sorted, plus 1." [374] The ninth line down of code did read: for (i = 0; i < (size / 8); i++) { Now reads: for (i = 0; i <= ((size - 1) / 8); i++) { <451> The second sentence in the fourth paragraph on the page has been changed to read: "To do this, we must ensure that the largest value that the block can store, considering its total number of bits, is less than n."