Solution Manual for Data Structures and Algorithm Analysis in C, 2/E 2nd Edition : 0201498405pdf download
Solution Manual for Data Structures and Algorithm Analysis in C, 2/E 2nd Edition : 0201498405pdf download
http://testbankbell.com/product/solution-manual-for-data-
structures-and-algorithm-analysis-in-c-2-e-2nd-
edition-0201498405/
http://testbankbell.com/product/solution-manual-for-data-structures-
and-algorithm-analysis-in-c-4-e-4th-edition-013284737x/
http://testbankbell.com/product/solution-manual-for-data-structures-
and-problem-solving-using-c-2-e-mark-a-weiss/
http://testbankbell.com/product/test-bank-for-data-structures-and-
algorithms-in-c-2nd-edition-by-goodrich/
http://testbankbell.com/product/solution-manual-for-statistics-for-
business-and-economics-8th-edition-by-newbold/
Solution Manual for Introductory Chemistry, 6th Edition,
Nivaldo J. Tro
http://testbankbell.com/product/solution-manual-for-introductory-
chemistry-6th-edition-nivaldo-j-tro/
http://testbankbell.com/product/test-bank-for-marketing-strategy-7th-
edition-o-c-ferrell-michael-hartline/
http://testbankbell.com/product/solution-manual-for-unified-design-of-
steel-structures-geschwindner-2nd-edition/
http://testbankbell.com/product/test-bank-for-developmental-
psychology-childhood-and-adolescence-9th-edition-by-shaffer/
http://testbankbell.com/product/test-bank-for-operations-and-supply-
chain-management-13th-edition-jacobs/
Test Bank for A Preface to Marketing Management 15th by
Peter
http://testbankbell.com/product/test-bank-for-a-preface-to-marketing-
management-15th-by-peter/
Solution Manual for Data Structures and
Algorithm Analysis in C, 2/E 2nd Edition :
0201498405
This book describes data structures, methods of organizing large amounts of data, and algorithm
analysis, the estimation of the running time of algorithms. As computers become faster and faster,
the need for programs that can handle large amounts of input becomes more acute. Paradoxically,
this requires more careful attention to efficiency, since inefficiencies in programs become most
obvious when input sizes are large. By analyzing an algorithm before it is actually coded, students
can decide if a particular solution will be feasible. For example, in this text students look at specific
problems and see how careful implementations can reduce the time constraint for large amounts of
data from 16 years to less than a second. Therefore, no algorithm or data structure is presented
without an explanation of its running time. In some cases, minute details that affect the running time
of the implementation are explored.
Once a solution method is determined, a program must still be written. As computers have become
more powerful, the problems they must solve have become larger and more complex, requiring
development of more intricate programs. The goal of this text is to teach students good programming
and algorithm analysis skills simultaneously so that they can develop such programs with the
maximum amount of efficiency.
This book is suitable for either an advanced data structures (CS7) course or a first-year graduate
course in algorithm analysis. Students should have some knowledge of intermediate programming,
including such topics as pointers and recursion, and some background in discrete math. Approach
I believe it is important for students to learn how to program for themselves, not how to copy
programs from a book. On the other hand, it is virtually impossible to discuss realistic programming
issues without including sample code. For this reason, the book usually provides about one-half to
three-quarters of an implementation, and the student is encouraged to supply the rest. Chapter 12,
which is new to this edition, discusses additional data structures with an emphasis on
implementation details.
The algorithms in this book are presented in ANSI C, which, despite some flaws, is arguably the
most popular systems programming language. The use of C instead of Pascal allows the use of
dynamically allocated arrays (see, for instance, rehashing in Chapter 5). It also produces simplified
code in several places, usually because the and (&&) operations is short-circuited.
Most criticisms of C center on the fact that it is easy to write code that is barely readable. Some of
the more standard tricks, such as the simultaneous assignment and testing against 0 via
if (x=y)
are generally not used in the text, since the loss of clarity is compensated by only a few keystrokes
and no increased speed. I believe that this books demonstrates that unreadable code can be
avoided by exercising reasonable care.
Overview
Chapter 1 contains review material on discrete math and recursion. I believe the only way to be
comfortable with recursion is to see good uses over and over. Therefore, recursion is prevalent in
this text, with examples in every chapter except Chapter 5.
Chapter 2 deals with algorithm analysis. This chapter explains asymptotic analysis and its major
weaknesses. Many examples are provided, including an in-depth explanation of logarithms running
time. Simple recursive programs are analyzed by intuitively converting them into iterative programs.
More complicated divide-and-conquer programs are introduced, but some of the analysis (solving
recurrence relations) is implicitly delayed until Chapter 7, where it is performed in detail.
Chapter 3 covers lists, stacks, and queues. The emphasis here is on coding these data structures
using ADTs, fast implementation of these data structures, and an exposition of some of their uses.
There are almost no programs (just routines), but the exercises contain plenty of ideas for
programming assignments.
Chapter 4 covers trees, with an emphasis on search trees, including external search trees (B-trees).
The UNIX file system and expression trees are used as examples. AVL trees and splay trees are
introduced but not analyzed. Seventy-five percent of the code is written, leaving similar cases to be
completed by the student. More careful treatment of search tree implementation details is found in
Chapter 12. Additional coverage of trees, such as file compression and game trees, is deferred until
Chapter 10. Data structures for an external medium are considered as the final topic in several
chapters.
Chapter 5 is relatively short chapter concerning hash tables. Some analysis is performed, and
extendible hashing is covered at the end of the chapter.
Chapter 6 is about priority queues. Binary heaps are covered, and there is additional material on
some of the theoretically interesting implementations of priority queues. The Fibonacci heap is
discussed in Chapter 11, and the pairing heap is discussed in Chapter 12.
Chapter 7 covers sorting. It is very specific with respect to coding details and analysis. All the
important general-purpose sorting algorithms are covered and compared. Four algorithms are
analyzed in detail: insertion sort, Shellsort, heapsort, and quicksort. The analysis of the average-
case running time of heapsort is new to this edition. External sorting is covered at the end of the
chapter.
Chapter 8 discusses the disjoint set algorithm with proof of the running time. This is a short and
specific chapter that can be skipped if Kruskal's algorithm is not discussed.
Chapter 9 covers graph algorithms. Algorithms on graphs are interesting, not only because they
frequently occur in practice but also because their running time is so heavily dependent on the
proper use of data structures. Virtually all of the standard algorithms are presented along with
appropriate data structures, pseudocode, and analysis of running time. To place these problems in a
proper context, a short discussion on complexity theory (including NP-completeness and
undecidability) is provided.
Chapter 12 is new to this edition. It covers search tree algorithms, the k-d tree, and the pairing heap.
This chapter departs from the rest of the text by providing complete and careful implementations for
the search trees and pairing heap. The material is structured so that the instructor can integrate
sections into discussions from other chapters. For example, the top-down red black tree in Chapter
12 can be discussed under AVL trees (in Chapter 4).
Chapters 1-9 provide enough material for most one-semester data structures courses. If time
permits, then Chapter 10 can be covered. A graduate course on algorithm analysis could cover
Chapters 7-11. The advanced data structures analyzed in Chapter 11 can easily be referred to in the
earlier chapters. The discussion of NP-completeness in Chapter 9 is far too brief to be used in such
a course. Garey and Johnson's book on NP-completeness can be used to augment this text.
Exercises
Exercises, provided at the end of each chapter, match the order in which material is presented. The
last exercises may address the chapter as a whole rather than a specific section. Difficult exercises
are marked with an asterisk, and more challenging exercises have two asterisks.
A solutions manual containing solutions to almost all the exercises is available to instructors from the
Addison-Wesley Publishing Company.
References
References are placed at the end of each chapter. Generally the references either are historical,
representing the original source of the material, or they represent extensions and improvements to
the results given in the text. Some references represent solutions to exercises.
Code Availability
The example program code in this book is available via anonymous ftp at aw. It is also accessible
through the World Wide Web; the URL is aw/cseng/authors/weiss/dsaac2/dsaac2e.sup.html (follow
the links from there). The exact location of this material may change.
Acknowledgments
Many, many people have helped me in the preparation of books in this series. Some are listed in
other versions of the book; thanks to all.
For this edition, I would like to thank my editors at Addison-Wesley, Carter Shanklin and Susan
Hartman. Teri Hyde did another wonderful job with the production, and Matthew Harris and his staff
at Publication Services did their usual fine work putting the final pieces together.
M.A.W.
Miami, Florida
July, 1996
0201498405P04062001
I T was decided that Mr. Whitman should make one of his delightful
visits to his friends, the Staffords, in their beautiful country home,
"Timber Creek," just as soon as he was sufficiently recovered to take
the trip, and Mrs. Davis thought best to defer talking with him or
considering any definite step regarding home matters until he
returned. She took pains to get him ready, and, as she had done
before, persuaded him to purchase some new clothing and look his
best. This visit, like previous ones, was charming to the poet, and he
came home much benefited. While he was away Mrs. Davis rested
and paid a short visit to the aged parents of Mrs. Fritzinger in
Doylstown, Pennsylvania. In this breathing spell she had thought
home matters over and had planned her mode of procedure; but
alas! when the poet appeared upon the spot and she had welcomed
him, the courage she had summoned up when he was out of sight
deserted her. She threw out hints, then made attempts to speak, but
to no avail; an understanding was not brought about and things
went on in the old fashion.
Much as Mr. Whitman enjoyed his visits and jaunts, coming back to
his own home was the one great joy of his life, and meeting his
housekeeper after even a brief absence was always a pleasure to
him.
It was quite late in the fall when he returned. He resumed his work
at once, and the winter was not an unpleasant one to him; only
somewhat tedious, because he was so closely confined to the house.
In other ways it was made cheerful with social events and agreeable
company, and it was brightened with anticipations of the delightful
drives to be enjoyed in the spring. (It was about this time that
Horace Traubel commenced to come to the house.)
Each season had added to his popularity, until he had attained the
zenith of his most sanguine imaginations; his most potent
daydreams had truly materialized; he was fully on the crest of the
wave! His housekeeping had surpassed his fondest expectations, for
to him his home was ideal. Deprivation was a thing of the past;
there was no lack of means, as private contributions were sent to
him amounting to many hundreds of dollars. That he was poor and
needy, and "was supported in his final infirmities by the kind interest
of his friends, who subscribed each his mite that the little old frame
house in Camden might shelter the snowy head of the bard to the
end," was the universal belief, and a kindly feeling was manifested
towards him in his own home and in England. It is to be regretted
that he was not better fitted physically to enjoy all his later
blessings.
Out-of-doors life seemed essential to him, and after a number of
outings he was able, as early as April 6, 1887, to read his Lincoln
lecture—the last he gave in his own city. It was well attended, and
listened to with deep attention. On the 12th of the same month he
went to New York for the purpose of reading his lecture there. He
was accompanied by William Duckett, a young friend who acted as
valet and nurse, and it was on his arm the old man leaned as he
came forward on the stage and stood a few minutes to acknowledge
the applause of the audience. When the tumult had subsided, the
poet sat down beside a stand, laid his cane on the floor, put on his
glasses and proceeded to read from a little book, upon whose pages
the manuscript and printed fragments were pasted.
"The lecturer was dressed in a dark sack coat, with dark gray
waistcoat and trousers, low shoes, and gray woollen socks. The
spotless linen of his ample cuffs and rolling collar was trimmed with
a narrow band of edging, and the cuffs were turned up over the
ends of his sleeves." Thus says the New York Tribune of the next
day, and it cannot be denied that his appearance did credit to his
housekeeper's attention at this time, as it did on all other public
occasions. The "spotless linen," however, was unbleached cotton,
one of the six new shirts Mrs. Davis had made for him.
The lecture was very successful. At the close, a little girl, Laura
Stedman, the five year old granddaughter of the "banker poet,"
walked out upon the stage and presented Mr. Whitman with a basket
of lilac blossoms. The New York Times had this account of the event
the next morning:
"Forth on the stage came a beautiful basket of lilac
blossoms, and behind it was a little bit of a maiden in a
white Normandy cap and a little suit of Quaker gray, her
eyes beaming, and her face deeply impressed with the
gravity of the occasion. She walked to where he sat and
held out her gift without a word. He started, took it and
then took her.
"It was December frost and May-time blossom at their
prettiest contrast, as the little pink cheek shone against
the snow-white beard, for the old man told his
appreciation mutely by kissing her and kissing her again,
the audience meanwhile applauding sympathetically."
Mr. Whitman then recited his poem "O Captain!" and the curtain fell
—fell to shut him from the sight of a New York audience forever.
Mrs. Davis always dreaded Mr. Whitman's New York visits, and this
episode caused her extra anxiety. She knew that his many and
influential friends would give him a warm welcome and a great
reception, and she also knew how prone the poet was to go beyond
the bounds of prudence. He could stand only a little fatigue and
excitement now. He returned in good condition, however, and she
flattered herself that a quiet summer was before them. He had told
her that this lecture (which increased his bank account by six
hundred dollars) was to be his last public function, but she had no
knowledge of something else he had in near view; something he had
already arranged for.
IX
A BUST AND A PAINTING
"Sidney Morse has made a second big head (bust), an
improvement, if I dare to say so, on the first. The second
is the Modern Spirit Awake and Alert as well as Calm—
contrasted with the antique and Egyptian calmness of the
first."—Walt Whitman.
testbankbell.com