This book teaches programming in a problem-driven way that focuses on problem solv- ing rather than syntax. We make introductory programming interesting by using thought- provoking problems in a broad context. The central thread of early chapters is on problem solving. Appropriate syntax and library are introduced to enable readers to write programs for solving the problems. To support the teaching of programming in a problem-driven way, the book provides a wide variety of problems at various levels of difficulty to motivate students. To appeal to students in all majors, the problems cover many application areas, including math, science, business, financial, gaming, animation, and multimedia.
The book seamlessly integrates programming, data structures, and algorithms into one text. It employs a practical approach to teach data structures. We first introduce how to use various data structures to develop efficient algorithms, and then show how to implement these data structures. Through implementation, students gain a deep understanding on the efficiency of data structures and on how and when to use certain data structures. Finally, we design and implement custom data structures for trees and graphs.
The book is widely used in the introductory programming, data structures, and algorithms courses in the universities around the world. This comprehensive version covers fundamen- tals of programming, object-oriented programming, GUI programming, data structures, algo- rithms, concurrency, networking, database, and Web programming. It is designed to prepare students to become proficient Java programmers. A brief version (Introduction to Java Pro- gramming, Brief Version, Eleventh Edition, Global Edition) is available for a first course on programming, commonly known as CS1. The brief version contains the first 18 chapters of the comprehensive version.
The best way to teach programming is by example, and the only way to learn programming is by doing. Basic concepts are explained by example and a large number of exercises with various levels of difficulty are provided for students to practice. For our programming courses, we assign programming exercises after each lecture.
Our goal is to produce a text that teaches problem solving and programming in a broad context using a wide variety of interesting examples. If you have any comments on and suggestions for improving the book, please email me.
Sincerely,
Y. Daniel Liang y.daniel.liang@gmail.com www.pearsonglobaleditions.com/Liang
fundamentals-first
problem-driven
data structures
comprehensive version
brief version
Preface
A01_LIAN1878_11_GE_FM.indd 3 1/2/18 11:57 PM
4 Preface
ACM/IEEE Curricular 2013 and ABET Course Assessment The new ACM/IEEE Computer Science Curricular 2013 defines the Body of Knowledge organized into 18 Knowledge Areas. To help instructors design the courses based on this book, we provide sample syllabi to identify the Knowledge Areas and Knowledge Units. The sample syllabi are for a three semester course sequence and serve as an example for institutional customization. The sample syllabi are accessible from the Instructor Resource Center.
Many of our users are from the ABET-accredited programs. A key component of the ABET accreditation is to identify the weakness through continuous course assessment against the course outcomes. We provide sample course outcomes for the courses and sam- ple exams for measuring course outcomes on the Instructor Resource Center.
What’s New in This Edition? This edition is completely revised in every detail to enhance clarity, presentation, content, examples, and exercises. The major improvements are as follows:
■■ The book’s title is changed to Introduction to Java Programming and Data Structures with new enhancements on data structures. The book uses a practical approach to introduce design, implement, and use data structures and covers all topics in a typical data structures course. Additionally, it provides bonus chapters that cover advanced data structures such as 2-4 trees, B-trees, and red-black trees.
■■ Updated to the latest Java technology. Examples and exercises are improved and simplified by using the new features in Java 8.
■■ The default and static methods are introduced for interfaces in Chapter 13.
■■ The GUI chapters are updated to JavaFX 8. The examples are revised. The user interfaces in the examples and exercises are now resizable and displayed in the center of the window.
■■ Inner classes, anonymous inner classes, and lambda expressions are covered using practi- cal examples in Chapter 15.
■■ More examples and exercises in the data structures chapters use lambda expressions to simplify coding. Method references are introduced along with the Comparator interface in Section 20.6.
■■ The forEach method is introduced in Chapter 20 as a simple alternative to the foreach loop for applying an action to each element in a collection.
■■ Use the default methods for interfaces in Java 8 to redesign and simplify MyList, MyArrayList, MyLinkedList, Tree, BST, AVLTree, MyMap, MyHashMap, MySet, MyHashSet, Graph, UnweightedGraph, and WeightedGraph in Chapters 24–29.
■■ Chapter 30 is brand new to introduce aggregate operations for collection streams.
■■ FXML and the Scene Builder visual tool are introduced in Chapter 31.