CS 221
Programming in C++ - Data Structures
Review for the Final Exam
In an attempt to give you some guidance as you study for the final exam I have
prepared the following review. It is, in fact, more than just a review for the
final exam, but a list of all knowledge and concepts you need to take with
you from this course into your future courses and career. Good luck!
-
General Knowledge
This information is part of the knowledge base you should have for all
areas of Computer Science.
-
What are the five steps in software development?
-
What are the four types of software testing that should be performed?
-
What are the eight most common "Big O" algorithm measures?
-
Software Documentation
What are each of the following documents and what role do they play in
the process of software development?
-
Statement of Work (SOW)
-
Requirements Description Document (RDD)
-
Software Requirements Specification (SRS)
-
Software Design Document (SDD) or Software Development Plan (SDP)
-
Software Test Plan (STP)
-
Terms
You should know the meanings of all the terms in this list.
-
General
-
Abstract Data Type
-
Acceptance testing
-
Algorithm
-
Analysis of Algorithms
-
Best-fit memory allocation
-
Binary search
-
Bottom-up Program Design
-
Call by Reference
-
Call by Value
-
Data Abstraction
-
Driver function for software testing
-
Dynamic memory allocation
-
Encapsulation
-
First-fit memory allocation
-
Fragmentation, when referring to the heap
-
Greedy algorithm
-
Heap, when referring to memory
-
Information hiding
-
Integration testing
-
Object oriented programming (OOP)
-
Procedural programming
-
Recursion
-
Regression testing
-
Sequential search
-
Software Validation
-
Software Verification
-
Static memory allocation
-
Stepwise Refinement
-
Stub function for software testing
-
Top-down Program Design
-
Unit testing
-
Trees
-
2-3 tree
-
AVL tree
-
B-tree
-
Binary tree and Binary Search tree
-
Child node
-
Complete binary tree
-
Heap, when referring to trees.
-
Internal node
-
Leaf node
-
Parent node
-
Root
-
Sub-tree or branches
-
Trie
-
Graphs
-
Adjacent vertices
-
Adjacency matrix
-
Adjacenty set
-
Connected components
-
Connected vertices
-
Cycle
-
Degree of a vertex
-
Directed graph
-
Edges
-
Minimal Spanning Tree of a graph
-
Path
-
Predecessors of a vertex
-
Shortest path in a graph
-
Simple cycle
-
Successors of a vertix
-
Vertices
-
Weighted graph
-
Sets
-
Component (base) type
-
Subset
-
Universal Set
-
Empty Set
-
Cardinality
-
Intersection of two sets
-
Difference of two sets
-
Symmetrical Difference of two sets
-
Union of two sets
-
Hashing
-
Cluster
-
Collision
-
Double hash function
-
Hash table
-
Hash function
-
Hashing with buckets
-
Hashing with chaining
-
Linear probing
-
Load factor
-
Open addressing
-
Perfect hash function
-
C++
-
Class
-
Constructor function
-
Destructor function
-
Function Overloading
-
Implementation file
-
Instantiation
-
Object oriented programming
-
Polymorphism
-
private, when referring to variables and functions
-
protected, when referring to variables and functions
-
public, when referring to variables and functions
-
Templates (Function and Class)
-
Pointers
You should know what a pointer is and how to declare and use pointers in each of the following:
-
Declare pointers to the 6 basic C data types.
-
Declare pointers to data structures.
-
Declare pointers to classes.
-
Use a pointer to store and retrieve data from any of the
6 basic C data types (char, short, int, long, float, double).
-
Use a pointer to store and retrieve data from a data structure given
a static instance of a structure (dot notation, i.e. s.val) and a pointer to a
dynamic instance of a structure (pointer notation, i.e. s->val).
-
Use a pointer to access public fields and functions in an instantiation of a class.
-
Pass an address stored in a pointer variable to a function that is
expecting a pointer as an argument and have that function read and/or
write a value into the variable using the pointer.
-
Pass the address of a variable to a function that is
expecting a pointer as an argument and have that function read and/or
write a value into the variable using the pointer.
-
Use the new operator to dynamically allocate
memory for variables, data structures, and classes and set pointers
pointing to them.
-
Create a call-by-reference function in C++ and make calls
to that function.
-
Data Structures
You should be able to define data structures for each of the following
uses:
-
Declare a simple data structure.
-
Declare a nested data structure, i.e. one that contains another
data structure.
-
Declare a data structure containing a pointer to a structure
of the same type.
-
Store and retrieve data in a data structure given a pointer
to the data structure, i.e. (using "->").
-
Store and retrieve data in a data structure given the name of
the data structure variable, i.e. (using "dot" notation).
-
Declare a Stack class containing a pointer to a StackItem
structure which can be used to implement a stack as a linked type.
-
Declare a Queue class containing a pointer to a QueueItem
structure to be used to implement a queue as a linked type.
-
Declare a data structure to be used in creating a linked list.
-
Declare a data structure to be used in creating a binary tree.
-
Declare the data structures and arrays needed to implement a
graph as an adjacency matrix.
-
Declare the data structures needed to implement a
graph as an adjacency set.
-
Algorithms
-
Lists, Stacks, and Queues
-
Be able to write the real or pseudocode for the Push() function
in a stack implemented as a linked list.
-
Be able to write the real or pseudocode for the Pop() function
in a stack implemented as a linked list.
-
Be able to write the real or pseudocode for the Enqueue() function
in a queue implemented as a linked list.
-
Be able to write the real or pseudocode for the Dequeue() function
in a queue implemented as a linked list.
-
Be able to write the real or pseudocode for the Insert() function in a linked list.
-
Be able to write the real or pseudocode for the Delete() function in a linked list.
-
Be able to write the real or pseudocode for the Search() function in a linked list.
-
Trees
-
Given the real code for the Insert() function in a binary tree
be able to fill in the blanks.
-
Given the real code for the Delete() function in a binary tree
be able to fill in the blanks.
-
Given the real code for the Search() function in a binary tree
be able to fill in the blanks.
-
Show the real code for performing a recursive, in-order traversal of
a binary tree.
-
Graphs
-
Explain how the basic search algorithm works when the "to visit"
node list is implementing as a stack and as a queue.
-
Explain how the basic algorithm works for constructing a minimal spanning tree.
(Only general approach, details not required)
-
Explain how the basic algorithm works for determining the shortest path.
(Only general approach, details not required)
-
Sets
-
What is the Union of two sets? Given example sets (A and B) show what the
Union of A and B would contain. What symbol is used to represent the Union
operation.
-
What is the Intersection of two sets? Given example sets (A and B) show what the
Intersection of A and B would contain. What symbol is used to represent the Intersection
operation.
-
What is the Difference of two sets? Given example sets (A and B) show what the
Difference of A and B would contain.
-
What is the Symmetrical Difference of two sets? Given example sets (A and B) show what the
Symmetrical Difference of A and B would contain.
-
Hashing
-
Show the real code for a Base-26 hash function which gets passed a 4-character
string and returns a hash index as an int. Assume table size is defined as TS
-
Show in real code or pseudocode how to calculate a hash function using Folding.
-
Show in real code or pseudocode how to calculate a hash function using Middle Squaring.
-
Show in real code or pseudocode how to calculate a hash function using Truncation.
-
Show in real code or pseudocode how to calculate a hash function using Division Method.
-
Sorting (You should know a one or two sentence description of how the sort works.
A detailed algorithm is not required.)
-
Comparison-based sorting
-
Transposition Sorting
-
Bubble Sort
-
Insert and Keep Sorting
-
Insertion Sort
-
Tree Sort
-
Priority Queue Sorting
-
Selection Sort
-
Heap Sort
-
Divide and Conquer Sorting
-
Quick Sort
-
Merge Sort
-
Diminishing Increment Sorting
-
Shell Sort
-
Address calculation sorting
-
Proxmap Sorting
-
Radix Sorting
-
Object Oriented Programming (C++)
You should know how to do the following in C++
-
Declare a class in C++
-
Use Stream IO (cout, cin, and the operators << and >>)
-
Declare variables in C++
-
Declare and use variables of the appropriate scope (public,
private, or protected).
-
Define and use overloaded functions.
-
Declare and use function templates.
-
Create and use namespaces.