Test 2, CSCI 385, Fall 2006

  1. [5 points] Give the definition of the term algorithm
  2. [3 points] Define the ADT list.
  3. [5 points] Compare and contrast lists and arrays. Discuss when it is better to use each.
  4. [5 points] Describe the ADT Stack.
  5. [5 points] State operations and performance expectations for this ADT.
  6. [10 points] Describe how a stack can be implemented using an array. Give pseudo code for the operations of an array based queue.
  7. [5 points] Describe the ADT Queue.
  8. [5 points] State operations and performance expectations for this ADT.
  9. [10 points] Describe how a stack can be implemented using a linked list. Give psedudo code for the operations on a list based queue.
  10. [5 points] Discuss when/why one may wish to use an array based implementation for a stack or queue.
  11. [5 points] Give the definition for a tree.
  12. [5 points] Give an algorithm to compute the height of a tree. What is the performance of your algorithm.
  13. [2 points] Define a binary tree.a
  14. [10 points] Given a binary tree, give an algorithm that will print the tree in a breadth first order. Discuss the performance of your algorithm.
  15. [10 points] Given a singly linked list, give a non-recursive algorithm that will print the list in reverse order. Discuss the performance of your algorithm.
  16. [10 points] Give an O(n) algorithm that will evaluate a polynomial stored in an array.