CptS 122 – Data Structures                                                                            

 

Final Exam Review Guide

 

This document will serve as a guide to help you prepare for the final written exam in CptS 122. You will find information about the exam format and topics you are expected to review within this guide.

 

What to Bring?


 Your WSU ID


 Two sharp pencils


 Calculators and other notes may not be used during the exam!


 

Exam Timeframe

 

The final exam is scheduled for Wednesday, December 12, 2012 from 1:00 pm – 3:00 pm. It will be held in our normally scheduled classroom location (TODD 216). Note that, when you hand in your exam, you will be required to present your WSU ID to the exam proctor.

 

Exam Format

 

Expect the final exam to look a lot like the two midterms, except that it will be longer, because you will have a full two hours to take the exam, rather than one hour. There will be a mix, of true-false, fill-in-the-blank, multiple-choice, and short answer/code questions that test your knowledge of key concepts. Expect also to supply short code snippets, and to trace through C/C++ code segments and specify their output.

 

Exam Coverage

 

The exam is comprehensive, covering all the material we have explored in this course.

Topics that are fair game from midterm #1:

Topics that are fair game from midterm #2:

The following is a list of exam topics covered in the final five weeks of the course:

C++ Data Structures

 

o       isEmpty ( ) - returns an integer or bool type; true for an empty list, false for non-empty list

o       insertAtFront ( ) – allocates a node dynamically; initializes it to the data passed in; inserts the node at the front of the list only; returns true or false for successful or unsuccessful insertion, respectively

o       insertAtBack ( ) - allocates a node dynamically; initializes it to the data passed in; inserts the node at the back or end of the list only; returns true or false for successful or unsuccessful insertion, respectively

o       insertInOrder ( ) - allocates a node dynamically; initializes it to the data passed in; inserts the node in the list in ascending or descending order only; returns true or false for successful or unsuccessful insertion, respectively

o       deleteNode ( ) – de-allocates a node dynamically; returns true if node was de-allocated, false otherwise

o       printList ( ) – prints out the data in each node of the list; may be printed iteratively or recursively

 

o       isEmpty ( ) - returns an integer or enumerated bool type; true for an empty stack, false for non-empty stack

o       push ( ) - allocates a node dynamically; initializes it to the data passed in; inserts the node at the top of the stack only; returns true or false for successful or unsuccessful insertion, respectively

o       pop ( ) - de-allocates a node at the top of the stack dynamically; returns true if node was de-allocated, false otherwise; NOTE: some variations of pop ( ) will return the data in the node found at the top of the stack, instead of true or false

o       top ( ) or peek ( ) – returns the data found in the top node of the stack; nodes are not affected (removed)

o       printStack ( ) - prints out the data in each node of the stack; may be printed iteratively or recursively

 

o      isEmpty ( ) - returns an integer or enumerated bool type; true for an empty queue, false for non-empty queue

o      enqueue ( ) - allocates a node dynamically; initializes it to the data passed in; inserts the node at the tail/back of the queue only; returns true or false for successful or unsuccessful insertion, respectively

o      dequeue ( ) - de-allocates a node at the head/front of the queue dynamically; returns the data in the node found at the head/front of the queue; NOTE: some implementations may also return true or false for successful or unsuccessful removal of a node from the head/front

o      printQueue ( ) - prints out the data in each node of the queue; may be printed iteratively or recursively

 

o      isEmpty ( ) - returns an integer or enumerated bool type; true for an empty BST, false for non-empty BST

o      insert ( ) – allocates a node dynamically; initializes it to the data passed in; inserts the node into the left or right subtree; returns true or false for successful or unsuccessful insertion, respectively

o      inOrder ( ) – performs an inorder traversal of a BST and prints out the data in the nodes accordingly

o      preOrder ( ) – performs a preorder traversal of a BST and prints out the data in the nodes accordingly

o      postOrder ( ) - performs a postorder traversal of a BST and prints out the data in the nodes accordingly

 

o      makeNode ( ) – allocates a node dynamically; initializes the node; returns a pointer to the dynamic node

Recommended Strategy for Preparing for the Exam

 

I recommend that you use the following activities and materials to prepare for the exam:



Review quizzes and lab exercises: These may well be your best resource. An excellent learning activity would be to retake the quizzes and review the lab exercises.


Lecture slides and example code: Study the lecture slides and example code. Continue to complete extra coding examples on your own time.


Read the textbook: Read or re-read chapters 12, 15 - 22, & 24 in your textbook and lecture notes. Solve the end-of-chapter exercises.