Sciweavers


Book

How to Think Like a Computer Scientist: C++ Version

15 years 9 months ago
How to Think Like a Computer Scientist: C++ Version
"The goal of this book is to teach you to think like a computer scientist. I like the way computer scientists think because they combine some of the best features of Mathematics, Engineering, and Natural Science. Like mathematicians, computer scientists use formal languages to denote ideas (specifically computations). Like engineers, they design things, assembling components into systems and evaluating tradeoffs among alternatives. Like scientists, they observe the behavior of complex systems, form hypotheses, and test predictions."
Allen B. Downey
Added 14 Feb 2009
Updated 14 Feb 2009
Authors Allen B. Downey
 1.1 What is a programming language?
1.2 What is a program?
1.3 What is debugging?
1.3.1 Compile-time errors
1.3.2 Run-time errors
1.3.3 Logic errors and semantics
1.3.4 Experimental debugging
1.4 Formal and natural languages
1.5 The first program
1.6 Glossary
2.1 More output
2.2 Values
2.3 Variables
2.4 Assignment
2.5 Outputting variables
2.6 Keywords
2.7 Operators
2.8 Order of operations
2.9 Operators for characters
2.10 Composition
2.11 Glossary
3.1 Floating-point
3.2 Converting from double to int
3.3 Math functions
3.4 Composition
3.5 Adding new functions
3.6 Definitions and uses
3.7 Programs with multiple functions
3.8 Parameters and arguments
3.9 Parameters and variables are local
3.10 Functions with multiple parameters
3.11 Functions with results
3.12 Glossary
4.1 The modulus operator
4.2 Conditional execution
4.3 Alternative execution
4.4 Chained conditionals
4.5 Nested conditionals
4.6 The return statement
4.7 Recursion
4.8 Infinite recursion
4.9 Stack diagrams for recursive functions
4.10 Glossary
5.1 Return values
5.2 Program development
5.3 Composition
5.4 Overloading
5.5 Boolean values
5.6 Boolean variables
5.7 Logical operators
5.8 Bool functions
5.9 Returning from main
5.10 More recursion
5.11 Leap of faith
5.12 One more example
5.13 Glossary
6.1 Multiple assignment
6.2 Iteration
6.3 The while statement
6.4 Tables
6.5 Two-dimensional tables
6.6 Encapsulation and generalization
6.7 Functions
6.8 More encapsulation
6.9 Local variables
6.10 More generalization
6.11 Glossary
7.1 Containers for strings
7.2 apstring variables
7.3 Extracting characters from a string
7.4 Length
7.5 Traversal
7.6 A run-time error
7.7 The find function
7.8 Our own version of find
7.9 Looping and counting
7.10 Increment and decrement operators
7.11 String concatenation
7.12 apstrings are mutable
7.13 apstrings are comparable
7.14 Character classification
7.15 Other apstring functions
7.16 Glossary
8.1 Compound values
8.2 Point objects
8.3 Accessing instance variables
8.4 Operations on structures
8.5 Structures as parameters
8.6 Call by value
8.7 Call by reference
8.8 Rectangles
8.9 Structures as return types
8.10 Passing other types by reference
8.11 Getting user input
8.12 Glossary
9.1 Time
9.2 printTime
9.3 Functions for objects
9.4 Pure functions
9.5 const parameters
9.6 Modifiers
9.7 Fill-in functions
9.8 Which is best?
9.9 Incremental development versus planning
9.10 Generalization
9.11 Algorithms
9.12 Glossary
10.1 Accessing elements
10.2 Copying vectors
10.3 for loops
10.4 Vector length
10.5 Random numbers
10.6 Statistics
10.7 Vector of random numbers
10.8 Counting
10.9 Checking the other values
10.10A histogram
10.11A single-pass solution
10.12Random seeds
10.13Glossary
11.1 Objects and functions
11.2 print
11.3 Implicit variable access
11.4 Another example
11.5 Yet another example
11.6 A more complicated example
11.7 Constructors
11.8 Initialize or construct?
11.9 One last example
11.10Header files
11.11Glossary
12.1 Composition
12.2 Card objects
12.3 The printCard function
12.4 The equals function
12.5 The isGreater function
12.6 Vectors of cards
12.7 The printDeck function
12.8 Searching
12.9 Bisection search
12.10Decks and subdecks
12.11Glossary
13.1 Enumerated types
13.2 switch statement
13.3 Decks
13.4 Another constructor
13.5 Deck member functions
13.6 Shuffling
13.7 Sorting
13.8 Subdecks
13.9 Shuffling and dealing
13.10Mergesort
13.11Glossary
14.1 Private data and classes
14.2 What is a class?
14.3 Complex numbers
14.4 Accessor functions
14.5 Output
14.6 A function on Complex numbers
14.7 Another function on Complex numbers
14.8 Invariants
14.9 Preconditions
14.10Private functions
14.11Glossary
15.1 Streams
15.2 File input
15.3 File output
15.4 Parsing input
15.5 Parsing numbers
15.6 The Set data structure
15.7 apmatrix
15.8 A distance matrix
15.9 A proper distance matrix
15.10Glossary
A.1 apstring
A.2 apvector
A.3 apmatrix
 
Comments (0)