This is a CS 2 book that presents classical data structures in an object-oriented programming (OOP) context using Java. This book also focuses on the basic principles of OOP and graphical user interface (GUI)-based programming – two paradigms essential for modern programming and problem solving. Our book is aimed principally at CS 2 students but may also be valuable to software development professionals who wish to upgrade their skills in the areas of OOP, GUI programming, and classical data structures.
The software development principles associated with OOP provide a strong framework for presenting and implementing classical data structures. We adhere to and emphasize these principles throughout this book.
Universities have been slow to introduce courses related to OOP into their curricula. Curriculum change has always occurred slowly at universities, but the past dozen years have been particularly disappointing in the area of OOP education. Often a department assumes that because it has switched language from Pascal or C to C++ or Java in CS 1 or CS 2 that it has made a commitment to object-oriented software education. This is simply not true. Object orientation embodies a set of principles often obscured by the intensive preoccupation with language details often evident in early university courses and the books that cater to these courses. The spate of CS 1 and CS 2 books featuring C++ or Java are often nothing more than warmed-over reruns of structured programming texts written originally for Pascal or C.
The principles of OOP and classical data structures are language independent. Our experience has shown that these principles need to be brought to life using well-crafted examples supported by a rich object-oriented programming language. In our view, Java fits this bill. It provides constructs and predefined standard libraries that directly support and connect to the rich body of underlying OOP and data structure principles. We have chosen Java because its usage is rising rapidly, it provides relative safety in programming, it is readily and inexpensively available (free in many cases), and it offers the user a clean and powerful object model. But make no mistake – this is not yet another book on Java programming. So what do we wish to achieve?
Part One of this book presents the basic principles of OOP and GUI programming. These principles are brought to life using examples crafted in Java. The principles and techniques presented in Part One of the book are carefully chosen to support Part Two of the book.