CS 2500 Study Guide for Quizzes
COMPUTER SCIENCE 2500 -- PROGRAMMING II


Chapter One -- Principles of Programming and Software Engineering

Study the following topics:

  1. What is an algorithm?
  2. Documentation, specification, and design
  3. Top-down design
  4. Abstraction and abstract data types
  5. Information hiding
  6. Modularity
  7. Modifiability
  8. Ease of Use
  9. Style

Chapter Two -- Recursion: The Mirrors

Study the following topics:

  1. Definition of a recursive function
  2. The Four Questions for constructing recursive solutions
  3. Runtime stack and activation records
  4. 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

  1. Assignments and Expressions
  2. Arithmetic Operators
  3. Input and Output using iostream

Chapter Three -- Data Abstraction

  1. Be able to define information hiding, and to explain how it helps create better software designs.
  2. Be able to define data abstraction and abstract data type.
  3. 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.
  4. Understand the connection between C++ classes and abstract data types.
  5. Know how to program a class and how to use a class as a client.

Chapter Four -- Linked Lists

  1. 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.
  2. 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.
  3. 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 ;
    } ;

  4. Be able to explain how nodes containing items are linked together to form linked lists.
  5. 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.
  6. Know how elements are inserted into a linked list and how they are deleted from a linked list.
  7. Understand the need for a special copy constructor and a special destructor when programming a linked list class that uses dynamic memory allocation.
  8. Know the relative advantages and disadvantages of array-based lists versus pointer-based lists.

Chapter Six -- Stacks

  1. Be familiar with the array-based and pointer-based implementations of stacks.
  2. Know the stack ADT operations and their uses.
  3. Know the kinds of problems that stacks are good for solving.
  4. Be able to read and understand C++ code that implements stacks. Be able to give pseudo code for stack operations.
  5. Know the advantages and disadvantages of array-based versus pointer-based versus list-based implementations of stacks.
  6. Be able to read code that uses a stack class, predict what the code will do, and what it will output.

Chapter Seven -- Queues

  1. Be familiar with the array-based and pointer-based implementations of queues.
  2. Know the queue ADT operations and their uses.
  3. Know the kinds of problems that queues are good for solving.
  4. Be able to read and understand C++ code that implements queues. Be able to give pseudo code for queue operations.
  5. Know the advantages and disadvantages of array-based versus pointer-based versus list-based implementations of queues.
  6. Be able to read code that uses a queue class, predict what the code will do, and what it will output.

Chapter Ten -- Trees

  1. 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.
  2. Be aware of the various traversal orders possible, the order they visit nodes in an arbitrary binary tree, and their possible applications.
  3. 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.
  4. 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.