CS 2500 Study Guide for Quizzes
COMPUTER SCIENCE 2500 -- PROGRAMMING II
Chapter One -- Principles of Programming and Software Engineering
Study the following topics:
What is an algorithm?
Documentation, specification, and design
Top-down design
Abstraction and abstract data types
Information hiding
Modularity
Modifiability
Ease of Use
Style
Chapter Two -- Recursion: The Mirrors
Study the following topics:
Definition of a recursive function
The Four Questions for constructing recursive solutions
Runtime stack and activation records
Given a recursive function, tell what it writes
Example:
void Nesto (int n)
{
cout << n;
if (n!=0)
{
Nesto(n-1);
cout << n ;
}
}
What is written if the call Nesto(0) is made?
What is written if the call Nesto(1) is made?
What is written if the call Nesto(2) is made?
What is written if the call Nesto(3) is made?
Appendix A -- be familiar with the following topics from pages A1
to A15
Assignments and Expressions
Arithmetic Operators
Input and Output using iostream
cin.get()
cout.put()
format stat flags and manipulators
cout.setf(ios::fixed)
cout.setf(ios::showpoint)
cout << setprecision(n)
Chapter Three -- Data Abstraction
Be able to define information hiding, and to explain
how it helps create better software designs.
Be able to define data abstraction and abstract
data type.
Know the definitions of class, object, data member, member
function, method, message, private member, public member,
constructor, destructor, header file, specification file,
implementation file, and any other C++ class terminology.
Understand the connection between C++ classes and abstract
data types.
Know how to program a class and how to use a class as a client.
Chapter Four -- Linked Lists
Know the terminology, concepts, and programming syntax
connected with pointer-based lists: pointers, dynamic allocation
of memory, using new, using delete, referencing
pointers (ptr->Item.serialNum), sequential search, traversal, and
so forth.
Know how to write program code that allocates, uses, and
deallocates dynamic arrays. Understand how the name of an array
equates to a pointer to the base element of the array.
Understand the equivalence of array indices to pointers.
Understand how to declare the C++ data types that are
necessary for setting up a linked list -- for example:
struct node ;
typedef node * ptrType ;
struct node
{
int Item ;
ptrType Next ;
} ;
Be able to explain how nodes containing items are linked
together to form linked lists.
Understand how an element is located in a linked list by
doing a sequential search. Understand the use of prev and cur
pointers in such a search.
Know how elements are inserted into a linked list and how
they are deleted from a linked list.
Understand the need for a special copy constructor and a
special destructor when programming a linked list class that uses
dynamic memory allocation.
Know the relative advantages and disadvantages of array-based
lists versus pointer-based lists.
Chapter Six -- Stacks
Be familiar with the array-based and pointer-based
implementations of stacks.
Know the stack ADT operations and their uses.
Know the kinds of problems that stacks are good for solving.
Be able to read and understand C++ code that implements
stacks. Be able to give pseudo code for stack operations.
Know the advantages and disadvantages of array-based versus
pointer-based versus list-based implementations of stacks.
Be able to read code that uses a stack class, predict what
the code will do, and what it will output.
Chapter Seven -- Queues
Be familiar with the array-based and pointer-based
implementations of queues.
Know the queue ADT operations and their uses.
Know the kinds of problems that queues are good for solving.
Be able to read and understand C++ code that implements
queues. Be able to give pseudo code for queue operations.
Know the advantages and disadvantages of array-based versus
pointer-based versus list-based implementations of queues.
Be able to read code that uses a queue class, predict what
the code will do, and what it will output.
Chapter Ten -- Trees
Know basic tree definitions and nomenclature -- terms like
binary tree, binary search tree, subtree, full tree, complete
tree, height, level, path, leaf, internal node, parent, sibling,
ancestor, descendent, root, and so forth.
Be aware of the various traversal orders possible, the order
they visit nodes in an arbitrary binary tree, and their possible
applications.
Understand the basics of what SearchTreeInsert and
SearchTreeDelete do. Given an initial diagram of a binary search
tree, be able to make another diagram showing what the tree will
look like after some series of insertions and deletions you are
told about.
Understand how the efficiency of search in a binary search
tree is related to whether the tree has near minimum height. Be
prepared to discuss the big-O of various binary search tree
operations - both average cases and worst cases.