(eBook PDF) Data Structures and Problem Solving Using Java 4th Edition - Quickly access the ebook and start reading today
(eBook PDF) Data Structures and Problem Solving Using Java 4th Edition - Quickly access the ebook and start reading today
com
https://ebookluna.com/product/ebook-pdf-data-structures-and-
problem-solving-using-java-4th-edition/
OR CLICK HERE
DOWLOAD EBOOK
https://ebookluna.com/product/ebook-pdf-data-structures-and-other-
objects-using-java-4th-edition/
ebookluna.com
https://ebookluna.com/product/ebook-pdf-data-structures-and-
abstractions-with-java-4th-edition/
ebookluna.com
https://ebookluna.com/product/ebook-pdf-data-structures-and-
abstractions-with-java-4th-global-edition/
ebookluna.com
https://ebookluna.com/product/ebook-pdf-starting-out-with-java-from-
control-structures-through-data-structures-4th-edition/
ebookluna.com
(eBook PDF) Java: An Introduction to Problem Solving and
Programming 7th Edition
https://ebookluna.com/product/ebook-pdf-java-an-introduction-to-
problem-solving-and-programming-7th-edition/
ebookluna.com
https://ebookluna.com/product/ebook-pdf-java-an-introduction-to-
problem-solving-and-programming-8th-edition/
ebookluna.com
https://ebookluna.com/product/data-structures-and-abstractions-with-
java-5th-edition-ebook-pdf/
ebookluna.com
https://ebookluna.com/product/ebook-pdf-introduction-to-programming-
with-java-a-problem-solving-approach-3rd-edition/
ebookluna.com
https://ebookluna.com/product/ebook-pdf-starting-out-with-java-from-
control-structures-through-data-structures-3rd-edition/
ebookluna.com
summary of changes in the fourth edition
a unique approach
My basic premise is that software development tools in all languages come with
large libraries, and many data structures are part of these libraries. I envision an
eventual shift in emphasis of data structures courses from implementation to use. In this
book I take a unique approach by separating the data structures into their specification
and subsequent implementation and taking advantage of an already existing data
structures library, the Java Collections API.
A subset of the Collections API suitable for most applications is discussed in a
single chapter (Chapter 6) in Part Two. Part Two also covers basic analysis techniques,
recursion, and sorting. Part Three contains a host of applications that use the
Collections API’s data structures. Implementation of the Collections API is not shown
until Part Four, once the data structures have already been used. Because the
Collections API is part of Java, students can design large projects early on, using
existing software components.
Despite the central use of the Collections API in this text, it is neither a book on the
Collections API nor a primer on implementing the Collections API specifically; it
remains a book that emphasizes data structures and basic problem-solving techniques.
Of course, the general techniques used in the design of data structures are applicable to
the implementation of the Collections API, so several chapters in Part Four include
Collections API implementations. However, instructors can choose the simpler
implementations in Part Four that do not discuss the Collections API protocol. Chapter
6, which presents the Collections API, is essential to understanding the code in Part
Three. I attempted to use only the basic parts of the Collections API.
Many instructors will prefer a more traditional approach in which each data structure
is defined, implemented, and then used. Because there is no dependency between
material in Parts Three and Four, a traditional course can easily be taught from this
book.
prerequisites
java
This textbook presents material using the Java programming language. Java is a
language that is often examined in comparison with C++. Java offers many benefits, and
programmers often view Java as a safer, more portable, and easier-to-use language than
C++.
The use of Java requires that some decisions be made when writing a textbook. Some
of the decisions made are as follows:
1. The minimum required compiler is Java 5. Please make sure you are using a
compiler that is Java 5-compatible.
2. GUIs are not emphasized. Although GUIs are a nice feature in Java, they seem
to be an implementation detail rather than a core Data Structures topic. We do
not use Swing in the text, but because many instructors may prefer to do so, a
brief introduction to Swing is provided in Appendix B.
3. Applets are not emphasized. Applets use GUIs. Further, the focus of the course
is on data structures, rather than language features. Instructors who would like
to discuss applets will need to supplement this text with a Java reference.
4. Inner classes are used. Inner classes are used primarily in the implementation
of the Collections API, and can be avoided by instructors who prefer to do so.
5. The concept of a pointer is discussed when reference variables are
introduced. Java does not have a pointer type. Instead, it has a reference type.
However, pointers have traditionally been an important Data Structures topic
that needs to be introduced. I illustrate the concept of pointers in other
languages when discussing reference variables.
6. Threads are not discussed. Some members of the CS community argue that
multithreaded computing should become a core topic in the introductory
programming sequence. Although it is possible that this will happen in the
future, few introductory programming courses discuss this difficult topic.
7. Some Java 5 features are not used. Including:
Static imports, not used because in my opinion it actually makes the code harder
to read.
Enumerated types, not used because there were few places to declare public
enumerated types that would be usable by clients. In the few possible places, it
did not seem to help the code’s readability.
text organization
Part One consists of four chapters that describe the basics of Java used throughout the
text. Chapter 1 describes primitive types and illustrates how to write basic programs in
Java. Chapter 2 discusses reference types and illustrates the general concept of a
pointer—even though Java does not have pointers—so that students learn this important
Data Structures topic. Several of the basic reference types (strings, arrays, files, and
Scanners) are illustrated, and the use of exceptions is discussed. Chapter 3 continues
this discussion by describing how a class is implemented. Chapter 4 illustrates the use
of inheritance in designing hierarchies (including exception classes and I/O) and
generic components. Material on design patterns, including the wrapper, adapter, and
decorator patterns can be found in Part One.
Part Two focuses on the basic algorithms and building blocks. In Chapter 5 a
complete discussion of time complexity and Big-Oh notation is provided. Binary search
is also discussed and analyzed. Chapter 6 is crucial because it covers the Collections
API and argues intuitively what the running time of the supported operations should be
for each data structure. (The implementation of these data structures, in both
Collections API-style and a simplified version, is not provided until Part Four). This
chapter also introduces the iterator pattern as well as nested, local, and anonymous
classes. Inner classes are deferred until Part Four, where they are discussed as an
implementation technique. Chapter 7 describes recursion by first introducing the notion
of proof by induction. It also discusses divide-and-conquer, dynamic programming, and
backtracking. A section describes several recursive numerical algorithms that are used
to implement the RSA cryptosystem. For many students, the material in the second half
of Chapter 7 is more suitable for a follow-up course. Chapter 8 describes, codes, and
analyzes several basic sorting algorithms, including the insertion sort, Shellsort,
mergesort, and quicksort, as well as indirect sorting. It also proves the classic lower
bound for sorting and discusses the related problems of selection. Finally, Chapter 9 is
a short chapter that discusses random numbers, including their generation and use in
randomized algorithms.
Part Three provides several case studies, and each chapter is organized around a
general theme. Chapter 10 illustrates several important techniques by examining games.
Chapter 11 discusses the use of stacks in computer languages by examining an algorithm
to check for balanced symbols and the classic operator precedence parsing algorithm.
Complete implementations with code are provided for both algorithms. Chapter 12
discusses the basic utilities of file compression and cross-reference generation, and
provides a complete implementation of both. Chapter 13 broadly examines simulation
by looking at one problem that can be viewed as a simulation and then at the more
classic event-driven simulation. Finally, Chapter 14 illustrates how data structures are
used to implement several shortest path algorithms efficiently for graphs.
Part Four presents the data structure implementations. Chapter 15 discusses inner
classes as an implementation technique and illustrates their use in the ArrayList
implementation. In the remaining chapters of Part Four, implementations that use simple
protocols (insert, find, remove variations) are provided. In some cases, Collections
API implementations that tend to use more complicated Java syntax (in addition to
being complex because of their large set of required operations) are presented. Some
mathematics is used in this part, especially in Chapters 19–21, and can be skipped at
the discretion of the instructor. Chapter 16 provides implementations for both stacks
and queues. First these data structures are implemented using an expanding array, then
they are implemented using linked lists. The Collections API versions are discussed at
the end of the chapter. General linked lists are described in Chapter 17. Singly linked
lists are illustrated with a simple protocol, and the more complex Collections API
version that uses doubly linked lists is provided at the end of the chapter. Chapter 18
describes trees and illustrates the basic traversal schemes. Chapter 19 is a detailed
chapter that provides several implementations of binary search trees. Initially, the basic
binary search tree is shown, and then a binary search tree that supports order statistics
is derived. AVL trees are discussed but not implemented, but the more practical red–
black trees and AA-trees are implemented. Then the Collections API TreeSet and
TreeMap are implemented. Finally, the B-tree is examined. Chapter 20 discusses hash
tables and implements the quadratic probing scheme as part of HashSet and HashMap,
after examination of a simpler alternative. Chapter 21 describes the binary heap and
examines heapsort and external sorting.
Part Five contains material suitable for use in a more advanced course or for general
reference. The algorithms are accessible even at the first-year level. However, for
completeness, sophisticated mathematical analyses that are almost certainly beyond the
reach of a first-year student were included. Chapter 22 describes the splay tree, which
is a binary search tree that seems to perform extremely well in practice and is
competitive with the binary heap in some applications that require priority queues.
Chapter 23 describes priority queues that support merging operations and provides an
implementation of the pairing heap. Finally, Chapter 24 examines the classic disjoint
set data structure.
The appendices contain additional Java reference material. Appendix A lists the
operators and their precedence. Appendix B has material on Swing, and Appendix C
describes the bitwise operators used in Chapter 12.
chapter dependencies
Generally speaking, most chapters are independent of each other. However, the
following are some of the notable dependencies.
Part One (Tour of Java): The first four chapters should be covered in their
entirety in sequence first, prior to continuing on to the rest of the text.
Chapter 5 (Algorithm Analysis): This chapter should be covered prior to
Chapters 6 and 8. Recursion (Chapter 7) can be covered prior to this chapter,
but the instructor will have to gloss over some details about avoiding inefficient
recursion.
Chapter 6 (The Collections API): This chapter can be covered prior to or in
conjunction with material in Part Three or Four.
Chapter 7 (Recursion): The material in Sections 7.1–7.3 should be covered
prior to discussing recursive sorting algorithms, trees, the Tic-Tac-Toe case
study, and shortest-path algorithms. Material such as the RSA cryptosystem,
dynamic programming, and backtracking (unless Tic-Tac-Toe is discussed) is
otherwise optional.
Chapter 8 (Sorting Algorithms): This chapter should follow Chapters 5 and 7.
However, it is possible to cover Shellsort without Chapters 5 and 7. Shellsort
is not recursive (hence there is no need for Chapter 7), and a rigorous analysis
of its running time is too complex and is not covered in the book (hence there is
little need for Chapter 5).
Chapter 15 (Inner Classes and Implementations of ArrayLists): This material
should precede the discussion of the Collections API implementations.
Chapters 16 and 17 (Stacks and Queues/Linked Lists): These chapters may be
covered in either order. However, I prefer to cover Chapter 16 first because I
believe that it presents a simpler example of linked lists.
Chapters 18 and 19 (Trees/Binary Search Trees): These chapters can be
covered in either order or simultaneously.
separate entities
mathematics
I have attempted to provide mathematical rigor for use in Data Structures courses that
emphasize theory and for follow-up courses that require more analysis. However, this
material stands out from the main text in the form of separate theorems and, in some
cases, separate sections or subsections. Thus it can be skipped by instructors in courses
that deemphasize theory.
In all cases, the proof of a theorem is not necessary to the understanding of the
theorem’s meaning. This is another illustration of the separation of an interface (the
theorem statement) from its implementation (the proof). Some inherently mathematical
material, such as Sections 7.4 (Numerical Applications of Recursion), can be skipped
without affecting comprehension of the rest of the chapter.
course organization
A crucial issue in teaching the course is deciding how the materials in Parts Two–Four
are to be used. The material in Part One should be covered in depth, and the student
should write one or two programs that illustrate the design, implementation, testing of
classes and generic classes, and perhaps object-oriented design, using inheritance.
Chapter 5 discusses Big-Oh notation. An exercise in which the student writes a short
program and compares the running time with an analysis can be given to test
comprehension.
In the separation approach, the key concept of Chapter 6 is that different data
structures support different access schemes with different efficiency. Any case study
(except the Tic-Tac-Toe example that uses recursion) can be used to illustrate the
applications of the data structures. In this way, the student can see the data structure and
how it is used but not how it is efficiently implemented. This is truly a separation.
Viewing things this way will greatly enhance the ability of students to think abstractly.
Students can also provide simple implementations of some of the Collections API
components (some suggestions are given in the exercises in Chapter 6) and see the
difference between efficient data structure implementations in the existing Collections
API and inefficient data structure implementations that they will write. Students can
also be asked to extend the case study, but again, they are not required to know any of
the details of the data structures.
Efficient implementation of the data structures can be discussed afterward, and
recursion can be introduced whenever the instructor feels it is appropriate, provided it
is prior to binary search trees. The details of sorting can be discussed at any time after
recursion. At this point, the course can continue by using the same case studies and
experimenting with modifications to the implementations of the data structures. For
instance, the student can experiment with various forms of balanced binary search trees.
Instructors who opt for a more traditional approach can simply discuss a case study
in Part Three after discussing a data structure implementation in Part Four. Again, the
book’s chapters are designed to be as independent of each other as possible.
exercises
Exercises come in various flavors; I have provided four varieties. The basic In Short
exercise asks a simple question or requires hand-drawn simulations of an algorithm
described in the text. The In Theory section asks questions that either require
mathematical analysis or asks for theoretically interesting solutions to problems. The In
Practice section contains simple programming questions, including questions about
syntax or particularly tricky lines of code. Finally, the Programming Projects section
contains ideas for extended assignments.
pedagogical features
The Key Concepts section lists important terms along with definitions and page
references.
The Common Errors section at the end of each chapter provides a list of
commonly made errors.
References for further reading are provided at the end of most chapters.
supplements
A variety of supplemental materials are available for this text. The following resources
are available at http://www.aw.com/cssupport for all readers of this textbook:
Source code files from the book. (The On the Internet section at the end of each
chapter lists the filenames for the chapter’s code.)
In addition, the following supplements are available to qualified instructors. To access
them, visit http://www.pearsonhighered.com/cs and search our catalog by title for Data
Structures and Problem Solving Using Java. Once on the catalog page for this book,
select the link to Instructor Resources.
PowerPoint slides of all figures in the book.
Instructor’s Guide that illustrates several approaches to the material. It includes
samples of test questions, assignments, and syllabi. Answers to select exercises
are also provided.
acknowledgments
Many, many people have helped me in the preparation of this book. Many have already
been acknowledged in the prior edition and the related C++ version. Others, too
numerous to list, have sent e-mail messages and pointed out errors or inconsistencies in
explanations that I have tried to fix in this edition.
For this edition I would like to thank my editor Michael Hirsch, editorial assistant
Stephanie Sellinger, senior production supervisor Marilyn Lloyd, and project manager
Rebecca Lazure and her team at Laserwords. Thanks also go to Allison Michael and
Erin Davis in marketing and Elena Sidorova and Suzanne Heiser of Night & Day
Design for a terrific cover.
Some of the material in this text is adapted from my textbook Efficient C
Visit https://testbankfan.com
now to explore a rich
collection of testbank or
solution manual and enjoy
exciting offers!
Programming: A Practical Approach (Prentice Hall, 1995) and is used with
permission of the publisher. I have included end-of-chapter references where
appropriate.
My World Wide Web page, , will contain
updated source code, an errata list, and a link for receiving bug reports.
M. A. W.
Miami, Florida
contents
1.2.2
1.3.2 constants
1.5.7 and
1.6 methods
1.6.1 overloading of method names
summary
key concepts
common errors
on the internet
exercises
references
2.3 strings
2.3.1 basics of string manipulation
2.4 arrays
2.4.1 declaration, assignment, and methods
2.4.3
summary
key concepts
common errors
on the internet
exercises
references
3.3 javadoc
VI
VII
SURGE UM PERIGO
VIII
IX
INTERROMPE-SE O EXITO
AS ADVERTENCIAS DO MAR
XI
FIM DO 2° VOLUME.
TRABALHADORES DO MAR
POR
VICTOR HUGO
traduzido por Machado de Assis
RIO DE JANEIRO
1866.
SEGUNDA PARTE
O engenhoso Gilliatt
LIVRO TERCEIRO
A luta
II
OS VENTOS DO LARGO
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookluna.com