Clicker Questions
Question 1: Assuming open addressing, what is the running time of inserting an element into a hash table with $n$ elements and a load factor of $0.5$?
Question 2: Assuming open addressing, what is the running time of inserting an element into a hash table with $n$ elements and only $10$ empty slots?
Question 3: Assuming separate chaining, what is the running time of inserting an element into a hash table with $n$ elements and a load factor of $f$?
Question 4: What is the running time of the following code:
1
2
k = 0;
for (i = 0; i < 1000*n; i++) k++;
Question 5: What is the running time of the following code:
1
2
3
4
k = 0;
for (i = 0; i < 2*n; i++) {
for (j = 0; j < 10000; j++) k++;
}
Question 6: What is the running time of the following code:
1
2
k = 0;
for (i = 1; i < (n * n); i *= 2) k++;
No Class Stats, PDF Download