The basis for education in the last millennium was "reading, writing, and arithmetic";
now it is reading, writing, and computing. Learning to program is an
essential part of the education of every student in the sciences and engineering.
Beyond direct applications, it is the first step in understanding the nature of computer
science’s undeniable impact on the modern world. This book aims to teach
programming to those who need or want to learn it, in a scientific context.
Our primary goal is to empower students by supplying the experience and
basic tools necessary to use computation effectively. Our approach is to teach students
that composing a program is a natural, satisfying, and creative experience.
We progressively introduce essential concepts, embrace classic applications from
applied mathematics and the sciences to illustrate the concepts, and provide opportunities
for students to write programs to solve engaging problems.
We use the Java programming language for all of the programs in this book—
we refer to "Java" after programming in the title to emphasize the idea that the
book is about fundamental concepts in programming, not Java per se. This book
teaches basic skills for computational problem solving that are applicable in many
modern computing environments, and is a self-contained treatment intended for
people with no previous experience in programming.
This book is an interdisciplinary approach to the traditional CS1 curriculum,
in that we highlight the role of computing in other disciplines, from materials science
to genomics to astrophysics to network systems. This approach emphasizes
for students the essential idea that mathematics, science, engineering, and computing
are intertwined in the modern world. While it is a CS1 textbook designed
for any first-year college student, the book also can be used for self-study or as a
supplement in a course that integrates programming with another field.
Author(s): Robert Sedgewick, Kevin Wayne
Edition: 2
Publisher: Addison Wesley
Year: 2017
Language: English
Commentary: True PDF
Pages: 780
Cover......Page 1
Title Page......Page 4
Copyright Page......Page 5
Contents......Page 8
Programs......Page 9
Preface......Page 12
1—Elements of Programming......Page 20
1.1 Your First Program......Page 21
1.2 Built-in Types of Data......Page 33
1.3 Conditionals and Loops......Page 69
1.4 Arrays......Page 109
1.5 Input and Output......Page 145
1.6 Case Study: Random Web Surfer......Page 189
2—Functions and Modules......Page 210
2.1 Defining Functions......Page 211
2.2 Libraries and Clients......Page 245
2.3 Recursion......Page 281
2.4 Case Study: Percolation......Page 319
3—Object-Oriented Programming......Page 348
3.1 Using Data Types......Page 349
3.2 Creating Data Types......Page 401
3.3 Designing Data Types......Page 447
3.4 Case Study: N-Body Simulation......Page 497
4—Algorithms and Data Structures......Page 512
4.1 Performance......Page 513
4.2 Sorting and Searching......Page 551
4.3 Stacks and Queues......Page 585
4.4 Symbol Tables......Page 643
4.5 Case Study: Small-World Phenomenon......Page 689
Context......Page 734
C......Page 740
F......Page 741
J......Page 742
O......Page 743
P......Page 744
W......Page 745
A......Page 748
B......Page 749
C......Page 750
D......Page 752
F......Page 754
G......Page 755
I......Page 756
J......Page 757
M......Page 758
O......Page 760
P......Page 761
Q......Page 762
R......Page 763
S......Page 764
T......Page 766
V......Page 767
Z......Page 768