Lecture 16, 18, 20

 0    23 flashcards    kapi2304
download mp3 print play test yourself
 
Question język polski Answer język polski
Quick sort uses which of the following algorithm to implement sorting?
start learning
divide and conquer
What is a randomized quick sort?
start learning
quick sort with random choice of pivot
What is the auxiliary space complexity of randomized quick sort?
start learning
O(log n)
What is the average time complexity of randomized quick sort?
start learning
O(n log n)
Randomized quick sort is an in place sort.
start learning
True
Randomized quick sort is a stable sort.
start learning
False
What is the best case time complexity randomized quick sort?
start learning
O(nlog n)
Which of the following is incorrect about randomized quicksort?
start learning
it cannot have a time complexity of O(n^2) in any case
What is the worst case time complexity of randomized quicksort?
start learning
O(n^2)
Using division method, in a given hash table of size 157, the key of value 172 be placed at position ____
start learning
15
Collisions can be reduced by choosing a hash function randomly in a way that is independent of the keys that are actually to be stored
start learning
True
What is the average retrieval time when n keys hash to the same slot?
start learning
Theta(n)
What is a hash table?
start learning
A data structure used to store key-value pairs
How does a hash table work?
start learning
It uses a hash function to map keys to array indices
What is the time complexity of inserting an element in a hash table?
start learning
O(1)
What is the worst-case time complexity of searching for an element in a hash table?
start learning
O(n)
What happens if two keys hash to the same index in a hash table?
start learning
A collision occurs
Depth First Search is equivalent to which of the traversal in the Binary Trees?
start learning
Pre-order Traversal
Time Complexity of DFS is? (V – number of vertices, E – number of edges)
start learning
O(V + E)
The Data structure used in standard implementation of Breadth First Search is?
start learning
Queue
The Depth First Search traversal of a graph will result into?
start learning
Tree
When the Depth First Search of a graph is unique?
start learning
When the graph is a Linked List
In Depth First Search, how many times a node is visited?
start learning
Equivalent to number of indegree of the node

You must sign in to write a comment