Non-Graded Exercises/Examples
This page provides exercises and examples for you to try. Since you'll learn the most in this class by doing rather than watching, I urge you to try as many of these as possible. As an incentive, each exam will have some questions that are isomorphic (i.e., same form, but possibly different variable names) to questions from this page.
There are typos in some of the programming examples from the textbook, so don't panic if your program does not work. Check your course notes, or ask us in office hours, if you're stuck.
Online Quizzes
The online quizzes are hosted on Connect. These quizzes are multiple-choice questions that you can take as many times as you like. They are not part of your formal assessment; however, they are a great source for practicing for exams. As an incentive for doing these practice questions, I guarantee that at each exam will have at least one question that is isomorphic (i.e., same form, but possibly different details) to one of these questions.
Practice questions + solutions posted September 1
Here are some sample midterm and final exam questions ... with solutions. Ignore the questions in those files that deal with topics we haven't covered (sometimes we present topics in a different order, or change the topics slightly).
For more sample questions try the tests/quizzes that are released on Connect throughout the term. Those online tests contain lots of sample midterm and final exam questions. Even though they are multiple-choice questions, we often tell students (on exams) to show their work, and we often award part marks for incorrect answers; therefore, we encourage you to work out the answers on a sheet of paper.
- Sample 1 & Answers
- Sample 2 & Answers
- Sample 3 & Answers
- Sample 4 & Answers
- Sample 5 & Answers
- Sample 6 & Answers
Introduction to C (Review from APSC 160) - Posted September 4
Recommended programming examples from the text book:
- First edition, Chapter 1: 2, 4, 7, 11, 18, 25, 36, 53
- First edition, Chapter 2: 1, 2, 3, 4
- First edition, Chapter 5: 2, 3, 5, 8, 10, 12, 15, 20, 29
- Second edition, Chapter 1: 1, 2, 3, 4, 5, 6, 7, 8
- Second edition, Chapter 3: 4, 6, 7, 8, 9, 10, 14, 23 - try to do 14 both with functions and without.
Pointers - Posted September 12
Recommended programming examples from the text book:
- First edition, Chapter 3: 3, 6, 12, 13
- First edition, Chapter 5: 21, 22, 24,
- Second edition, Chapter 1: 9; Also programming exercises (end of chapter) 23, 24, 25
- Second edition, Chapter 3: 15
- Try going back to some of the examples from the previous section, Introduction to C, and rewriting them using pointers
Structs - Posted September 23
Recommended programming examples from the text book:
- First edition, Chapter 7: 1, 5, 6, 9, 13, 14
- Second edition, chapter5: 1, 3, 4, 6
Complexity - Posted October 1
Recommended examples from the text book:
- Second edition, chapter2: Examples 2.1 - 2.9 (page 58 -62)
Linked lists - Posted October 5
Recommended programming examples from the text book:
- First edition, Chapter 8: 1, 2, 4
- Second edition, chapter6: 1, 3, 6
Recommended programming exercises (end of chapter questions) from the text book:
- First edition, Chapter 8: 1, 2, 4, 7, 12, 17, 33
- Second edition, chapter6: 1, 2, 5, 7, 12, 17, 33
Stack, Queue, and Recursion - Posted October 14
Recommended programming examples and exercises from the text book:
- First edition, Chapter 9: 1, 2, 5, 8, 9, 10
- First edition, Chapter 2 (exercises): 15, 17, 20, 21
- Second edition, chapter6: 1, 2, 4, 5, 7, (exercise)10
- Second edition, chapter7: 1, 2, 3
Binary Search Trees - Posted Nov 3
Recommended programming examples and exercises from the text book:
- First edition, Chapter 10, 11 All of the non programming examples and non programming exercises related to Binary Search Trees
- First edition, Chapter 11: 1 (exercises)1, 2
- Second edition, Chapter 9, 10 All of the non programming examples and non programming exercises related to Binary Search Trees
- Second edition, Chapter 10: 1
Heaps - Posted Nov 9
Recommended programming examples and exercises from the text book:
- Both editions All of the non programming examples and non programming exercises related to heaps are really useful
Sorting - Posted Nov 19
Recommended programming examples and exercises from the text book:
- Both editions All of the non programming examples and non programming exercises related to sorting are really useful
- There are plenty of in-class exercises in the lecture slides for sorting
Hashing - Posted Nov 28
Recommended programming examples and exercises from the text book:
- Both editions All of the exercises related to chaining and open addressing are really useful
- There are plenty of in-class exercises in the lecture slide