Slippery Rock University Dr. Deborah Whitfield Go Browns!

Exam 3 prep
Data Structures and Algorithms in Java
CpSc 374

Hash Tables

  1. Given a hash table size,
    1. Use linear probing to insert a list of numbers
    2. Use quadratic probing to insert a list of numbers
  2. Given a hashtable and a second hash function, use double hashing to insert a list of numbers
  3. What is a collision?
  4. What strategies could we use to handle a collision?

Heap

  1. for the heap above, list the nodes in order that would be examined to find 9
  2. for the heap above, list the nodes in order that would be examined to find 100
  3. for the heap above, list the nodes in order that would be examined to find 4
  4. for the heap above, list the nodes in order that would be examined to find 80
  5. for the heap above, give the tree after deleting 98
  6. for the heap above, give the tree after deleting 75
  7. for the heap above, give the tree after deleting 9
  8. for the heap above, give the tree after inserting 3
  9. for the heap above, give the tree after inserting 100
  10. for the heap above, give the tree after inserting 81
  11. if the heap is stored in an array, what are the indices of the children of the node stored in index 43
  12. if the heap is stored in an array, what is the index of the parent of the node stored in index 43

Graphs

  1. Given a graph, what is the adjacency list of vertices
  2. Given a graph, what is the adjacency matrix representing the edges
  3. Given a graph, what is the BST beginning at node 1
  4. Given a graph, what is the DST beginning at node 1
  5. Given a directed graph, what is the adjacency matrix representing the edges