17 Questions on Data Structures - Homework | CS 261, Assignments of Data Structures and Algorithms

Material Type: Assignment; Class: DATA STRUCTURES; Subject: Computer Science; University: Oregon State University; Term: Spring 2004;

Typology: Assignments

Pre 2010

Uploaded on 08/30/2009

koofers-user-o31
koofers-user-o31 🇺🇸

10 documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS261 Homework Name: ____________________________________
due 6/4 4PM
1. What are the 2 data structures usually used to implement a priority queue?
A.
B.
2. What is the underlying structure of ‘A’?
3. What is the underlying structure of ‘B’?
4. Are the algorithms for insertion and deletion the same for ‘A’ and ‘B’? Why or why not?
5. Is it common to search a priority queue for a specific value?
6. Is an enumeration of a priority queue in order?
7. Why don’t we just use a SortedVector or an AVLTree for a priority queue? Be brief, but complete.
pf3
pf4
pf5

Partial preview of the text

Download 17 Questions on Data Structures - Homework | CS 261 and more Assignments Data Structures and Algorithms in PDF only on Docsity!

CS261 Homework Name: ____________________________________ due 6/4 4PM

  1. What are the 2 data structures usually used to implement a priority queue? A. B.
  2. What is the underlying structure of ‘A’?
  3. What is the underlying structure of ‘B’?
  4. Are the algorithms for insertion and deletion the same for ‘A’ and ‘B’? Why or why not?
  5. Is it common to search a priority queue for a specific value?
  6. Is an enumeration of a priority queue in order?
  7. Why don’t we just use a SortedVector or an AVLTree for a priority queue? Be brief, but complete.
  1. Insert a 50 in the following priority queue (implemented as a __________________ data structure)
  2. Now remove the smallest element from the result. Draw the tree below.
  1. Remove the smallest element from the resulting tree in #10. Show all your steps.
  1. What is a hash function used for?
  2. If the hash function is very good, the load factor is reasonable, the table size is prime—what is the expected big Oh execution time of insertion and of search in a hashtable?
  3. What is a collision?
  4. Insert the value Corvallis and then Wren and then Philomath into the following hash tables using the indicated collision resolution scheme. Corvallis hashes to 4 and double hashes to 5. Wren hashes to 13 and double hashes to 2. Philomath hashes to 3 and double hashes to 4. Linear Probing Quadratic Probing Double Hashing Chaining (Buckets) Eugene

Bend Portland Newport Scio Yachats Eugene Bend Yachats Eugene Bend Yachats Eugene Bend Yachats Portland Portland Portland Newport Newport Newport Scio Scio Scio Sisters