PDF C Data Structures A Laboratory Course Stefan Brandle download
PDF C Data Structures A Laboratory Course Stefan Brandle download
com
https://ebookname.com/product/c-data-structures-a-
laboratory-course-stefan-brandle/
OR CLICK BUTTON
DOWNLOAD EBOOK
https://ebookname.com/product/data-structures-using-c-2nd-edition-a-k-
sharma/
ebookname.com
https://ebookname.com/product/c-plus-data-structures-third-edition-
nell-dale/
ebookname.com
https://ebookname.com/product/adts-data-structures-and-problem-
solving-with-c-2nd-edition-nyhoff/
ebookname.com
https://ebookname.com/product/an-introduction-to-tensegrity-anthony-
pugh/
ebookname.com
https://ebookname.com/product/public-services-issues-with-rare-and-
archival-law-materials-1st-edition-michael-widener/
ebookname.com
https://ebookname.com/product/john-paul-ii-on-the-vulnerable-1st-
edition-jeffrey-tranzillo/
ebookname.com
https://ebookname.com/product/militant-right-wing-extremism-in-putin-
s-russia-legacies-forms-and-threats-jan-holzer/
ebookname.com
https://ebookname.com/product/congress-the-first-branch-benjamin-
ginsberg/
ebookname.com
Managing People in Entrepreneurial Organizations Advances
in Entrepreneurship Firm Emergence and Growth Advances in
Entrepreneurship Firm Emergence Entrepreneurship Firm
Emergence and Growth 1st Edition Jerome A. Katz
https://ebookname.com/product/managing-people-in-entrepreneurial-
organizations-advances-in-entrepreneurship-firm-emergence-and-growth-
advances-in-entrepreneurship-firm-emergence-entrepreneurship-firm-
emergence-and-growth-1st-editi/
ebookname.com
++ Third Edition
C
Data Structures
A Laboratory Course
Stefan Brandle
Taylor University
Jonathan Geisler
Taylor University
James Robergé
David Whittington
Filtro Systems, Inc.
Jones and Bartlett's books and products are available through most bookstores and online booksellers.
To contact Jones and Bartlett Publishers directly, call 800-832-0034, fax 978-443-8000, or visit our website
www.jbpub.com.
Substantial discounts on bulk quantities of Jones and Bartlett's publications are available to
corporations, professional associations, and other qualified organizations. For details and specific discount
information, contact the special sales department at Jones and Bartlett via the above contact information or
send an email to specialsales@jbpub.com.
ISBN-13: 978-0-7637-5564-5
All rights reserved. No part of the material protected by this copyright may be reproduced or utilized in
any form, electronic or mechanical, including photocopying, recording, or by any information storage and
retrieval system, without written permission from the copyright owner.
Production Credits
Acquisitions Editor: Tim Anderson
Production Director: Amy Rose
Editorial Assistant: Melissa Elmore
Senior Marketing Manager: Andrea DeFronzo
Manufacturing Buyer: Therese Connell
Composition: Northeast Compositors
Cover Design: Kate Ternullo
Cover Image: © Cocota Anca/ShutterStock, Inc.
Printing and Binding: Courier Stoughton
Cover Printing: Courier Stoughton
6048
Printed in the United States of America
12 11 10 09 08 10 9 8 7 6 5 4 3 2 1
To Christina, Anna, and Esther, for giving me the time to work on this.
—Stefan Brandle
To the women in my life. Thanks for the great deal of understanding with so
little payback time.
—Jonathan Geisler
1 Text ADT
Focus: Implement an ADT using a C++ class, introduce a number of
foundational C++ concepts used in ADT implementation, and an
array implementation of a delimited character string
Application: Lexical analysis
2 BlogEntry ADT
Focus: Implement a blog entry class and continue introduction of
foundational C++ concepts used in ADT implementation
Application: Generate an HTML representation of a data structure's contents
6 Stack ADT
Focus: Array and singly linked list implementations of a stack
Application: Evaluating postfix arithmetic expressions
7 Queue ADT
Focus: Array and singly linked list implementations of a queue
Application: Simulating the flow of customers through a line
11 Heap ADT
Focus: Array implementation of a heap
Application: Simulating the flow of tasks in an operating system using a
priority queue
13 Performance Evaluation
Focus: Determining execution times
Application: Analyzing the execution times of sorting and searching routines
preface
Preface to the Third Edition
We have used James Robergé's laboratory manual for eight years at Taylor
University. The approach and style of the original manual made it an extremely
effective teaching tool. In 2002, we were given the privilege of updating the first
edition to reflect changes in C++ and to add some new material.
It is now time for a third edition. Perhaps most significantly, all the worksheet
pages—which comprised a high percentage of the book—were moved into a set
of online supplements that instructors and students can print as needed. The
appendix material is now widely available online from multiple sources.
We discovered that many of those using the book are now using it for more
advanced courses such as Data Structures and Algorithms. A major reason for
this is that many universities have switched the second computer science course
(CS2, sometimes also called Data Structures) from C++ to Java. Given that the
target audience has shifted somewhat, and that students using the lab book have
probably already encountered Object-Oriented Programming, we chose to
increase the level of C++ and data structure sophistication. However, we ensured
that the book is still very usable for CS2—which is where we continue to use it.
Aspects of the second edition were out of date because of changes in the C++
language. Also, compilers have caught up enough with newer C++ standards that
we can safely use some of the features that either did not exist previously, or
were not reliably supported by enough common compilers. For example, the use
of typename instead of class in templates.
Our goal to be true to Jim Robergé's original vision of the laboratory
experience remains, but we also recognize that the book is no longer necessarily
used with the classic closed lab. As a consequence, we modified our
nomenclature. For instance, In-Lab Exercises are now called Programming
Exercises. Post-Lab Exercises are now called Analysis Exercises. These can still
be used as in-lab/post-lab exercises with a closed lab, but the naming more
accurately reflects the reality that these labs can be used equally well as regular
weekly programming assignments in a non-laboratory course.
Overview of Changes
Each chapter has been organized into Objectives, ADT Overview, C++
Concepts Overview, ADT Specification, Implementation Notes, Compilation
Directions, and Testing. Then, there are three Programming Exercises and two
Analysis Exercises.
We also made the following significant changes:
• The word class in templates has been replaced by the new keyword
typename. The keyword typename is intuitively more self-explanatory
and is not as overloaded as class.
• For the linked data structures where we had external “Node” classes, they
have become inner classes. Although inner classes add a small amount of
syntax, it gets away from the issues of forward declarations for mutually
referring classes. This represents better object-oriented design and we
avoid the use of declaring class friends.
• The isFull operation has been removed from linked data structures where
it is not required for compatibility with the array-based version. We do
this because determining whether dynamic memory is exhausted is a
fruitless and inefficient exercise. In reality, C++ provides an exception
mechanism to deal with this issue.
• Lab order has been changed to be compatible with the order in the largest
number of current textbooks. The singly-linked list was moved up to Lab
5 right after the two array-based lists; the expression tree is now before
the binary search tree; the string lab was moved to Lab 1; and the
BlogEntry ADT—the only new lab—is Lab 2.
Note: We still do not use STL in this book (except for one example in the
Performance Analysis lab). However, the STL implementation of a data structure
could be substituted for the student's implementation in necessary situations.
To the Student
Objectives
The courses that we enjoyed most when we were students were those that
emphasized design. In design-oriented courses, we used the concepts taught to
solve practical problems. The process of applying ideas made it easier to
understand them and their application in a real-world setting.
This emphasis on learning by doing is used throughout this book. In each
laboratory, you will explore a particular data structure by implementing it. As
you create an implementation, you will learn how the data structure works and
how it can be applied. The resulting implementation is a working piece of
software that you can later use in laboratories and programming projects.
Student Resources
The authors have compiled a set of worksheets, interactive tools to test and
debug your work, and “starter kits” containing data, partial solution shells, and
other supporting routines for each of your labs. These tools are available for
download at the Jones and Bartlett lab book website
http://www.jbpub.com/catalog/9780763755645.
To the Instructor
Objectives
In the initial development of these labs, an attempt was made to shoehorn the
creative process into a series of two-hour laboratories. The result was a pressure
cooker that challenged everyone, but helped no one. In experimenting with
solutions to this problem, James Robergé developed a laboratory framework that
retains the creative element but shifts the time-intensive aspects outside the
laboratory period. Within this structure, each laboratory includes three parts:
Basic Implementation and Testing, Programming Exercises, and Analysis
Exercises.
The Basic Implementation section explains the specific Abstract Data Type
(ADT), introduces the new C + + concepts, describes the ADT's properties,
explains implementation details that the student needs to know, and then guides
the student through testing his/her implementation. In the three Programming
Exercises, the first exercise is usually to apply the data structure to the solution
of a problem. The remaining two exercises usually apply or extend the concepts
introduced in the Basic Implementation. The last part of each laboratory, the
Analysis Exercise, is an assignment which analyzes a data structure in terms of
its efficiency or use.
Basic Implementation
The Basic Implementation exercise is intended as a homework assignment
that links the lecture with the laboratory period. Students explore and create on
their own and at their own pace. Their goal is to synthesize the information they
learn in lectures with material from their textbook to produce a working piece of
software, usually an implementation of an abstract data type (ADT). The
implementation assignment— including a review of the relevant lecture and
textbook materials—typically takes four to five hours to complete. We have tried
to include all necessary discussions of new C++ material, implementation
details, special compilation directions, and testing instructions. You should give
students specific instructions for compilation in your laboratory environment.
An interactive, command-driven test program is provided for each laboratory,
along with a text-based visualization routine that allows students to see changes
in the content and organization of a data structure. This part of the assignment
provides an opportunity for students to receive feedback on their basic
implementation and to resolve any difficulties they might have encountered. It
should take students approximately one hour to finish this exercise. Students are
often tempted to skimp on the testing, resulting in poorly implemented
submissions. Requiring students to complete and submit the test plans in the
online worksheets can significantly improve the quality of submissions.
Programming Exercises
This section takes place during the actual laboratory period (assuming you
are using a closed laboratory setting). Each lab contains three exercises, and each
exercise has a distinct role. In Exercise 1, students apply the software they
developed in the Basic Implementation to a real-world problem that has been
honed to its essentials to fit comfortably within the closed laboratory
environment. The last two exercises stress programming by extending the data
structure, and provide a capstone to the basic implementation. Exercise 1 can be
completed in approximately one and a half hours. Exercises 2 and 3 can take as
much as one hour each to complete, but students who did the initial work
thoroughly have a better understanding and can finish more quickly.
Most students will not be able to complete all these programming exercises
within a typical closed laboratory period. We have provided a range of exercises
so that you can select those that best suit your laboratory environment and your
students' needs.
Analysis Exercises
The last phase of each laboratory is a set of two homework assignments in
which students analyze the efficiency or utility of a given data structure. Each
Analysis Exercise should take roughly thirty minutes to complete. Assuming a
closed laboratory structure, one or both could be done following the laboratory
period.
Basic Implementation
We expect the students attending a two-hour closed laboratory to make a
good-faith effort to complete the basic implementation exercise before coming to
the lab. Their work need not be perfect, but their effort must be real (roughly
80% correct). We ask our students to complete the test plans and to begin testing
and debugging their implementation work prior to coming to lab (as part of the
80% correct guideline).
Programming Exercises
We use the first hour of the laboratory period to resolve any problems the
students might have experienced in completing the Basic Implementation and
Testing. Our intention is to give constructive feedback so that students leave the
lab with a working implementation—a significant accomplishment on their part.
During the second hour, we have students complete one of the programming
exercises in order to reinforce the concepts learned in the basic implementation.
You can choose the exercise by section or by student, or you can let the students
decide which one to complete.
Students leave the lab having received feedback on their basic implementation
and additional programming exercise work. You need not rigidly enforce the
hourly divisions; a mix of activities keeps everyone interested and motivated.
Analysis Exercises
After the lab, the students complete one (or both) of the analysis exercises
and turn it in during their next lab period.
Basic Implementation
If we have only one hour for the closed laboratory, we ask students to
complete all of the Basic Implementation and Testing before they come to the
lab. This work is turned in at the start of the period.
Programming Exercises
During the laboratory period, the students complete one of the additional
programming exercises.
Analysis Exercises
Again, the students complete one or both of the analysis exercises and
submit it during their next lab period.
Open Laboratory
Student Preparation
This manual assumes that students have a background in either Java or C++.
The first laboratory introduces classes and the use of classes to implement a
simple ADT. Succeeding laboratories introduce more complex C++ language
features (dynamic memory allocation, templates, inheritance, and so forth) in the
context of data structures that use these features.
Order of Topics
All instructors cover the course material in the order that they believe best
suits their students' needs. To give instructors flexibility in the order of
presentation, we have made the individual laboratories as independent of one
another as possible. At a minimum, we recommend beginning with the following
sequence of laboratories:
We have placed the performance evaluation laboratory at the end of the book
(Laboratory 13), because in our experience, we have found that everyone covers
this topic at a different time. Rather than bury it in the middle of the manual, we
have placed it at the end so that you can include it where it best serves you and
your students' needs, be that early in the semester, in the middle, or toward the
end.
ADT Implementation
We have found that variations in style between the approaches used in the
textbook and the laboratory manual discourage students from simply copying
material from the textbook. Having to make changes, however slight, encourages
them to examine in more detail how a given implementation works.
Exploring the Variety of Random
Documents with Different Content
small donations ($1 to $5,000) are particularly important to
maintaining tax exempt status with the IRS.
Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.
Most people start at our website which has the main PG search
facility: www.gutenberg.org.