Programming and Data Structures - Fall 2005
Course outline
Course Documents
(Unfurl all levels)
(Fold all back)
Resources
fstream for file I/O
cctype library
Stanford CS Education Library
Exercise Set 1
Exercises
Solution to the Exercises
Exercise Set 2
Exercises
Solution to the Exercises
Test 1
Test 1
Structs and Classes in C++
Notes on C++ structs
Struct Example 1
Struct Example 2
Struct Example 3
Additional Exercises on Pointers, Arrays, Strings
Additional Exercises on Pointers,Arrays and Strings
Exercise Set 3
Exercises
Solution to the Exercises
Recursion
Recursive Function Example 1
Recursive Function Example 2
Exercise Set 4
Exercises
Solution to the Exercises
Sorting Algorithms
Notes on Sorting
Bubble Sort Animation by Alejo Hausner
Notes on bubble sort
Insertion sort
Shell sort
Merge Sort
Quick sort
Midterm Exam
Midterm Test
Solution to Question 1
Sample Input file for Question 1
Solution to Question 2
Makefile Examples
Makefile
a.h
a.c
b.h
b.c
main.cpp
Linked Lists
A simple Linked List example
An Exercise based on the above example
A more complex example
Source Code for the example
Student.h
Student.cpp
StudentNode.h
StudentNode.cpp
StudentList.h
StudentList.cpp
Exercises on Linked Lists
Solutions
Solution to exercise 1
Solution to exercise 3
Solution to exercise 4
Additional Exercises with Solutions
Stacks
Stacks
Stacks - Another Example
Exercises
Solutions
Solution to the above exercise
Queues
Queues
Exercises
Test 2
Test 2
A possible solution
(See the is_in() function definition in the complete program.)
Trees
Notes on Trees
Binary Tree
Building a Binary Search Tree
Exercises
Solutions
Tree Traversal and Reverse Polish Notation
Binary Search Tree Deletion Operation
More Exercises on Trees
Solutions
Still More Exercises on Trees
Binary Search Tree Code
(C++ code for Traversals, Search, finding Successor, Predecessor etc.)
Hashing and Hash Tables
Notes on Hashing
Text file used in the example in the notes above
Exercises
Text File with 10000 words
Notes on Searching
Test 3
Notes on Heaps/PriorityQueues
Course Overview
Final Exam and Solutions