Lecture 16, 18, 20

 0    23 fiche    kapi2304
Télécharger mP3 Imprimer jouer consultez
 
question język polski réponse język polski
Quick sort uses which of the following algorithm to implement sorting?
commencer à apprendre
divide and conquer
What is a randomized quick sort?
commencer à apprendre
quick sort with random choice of pivot
What is the auxiliary space complexity of randomized quick sort?
commencer à apprendre
O(log n)
What is the average time complexity of randomized quick sort?
commencer à apprendre
O(n log n)
Randomized quick sort is an in place sort.
commencer à apprendre
True
Randomized quick sort is a stable sort.
commencer à apprendre
False
What is the best case time complexity randomized quick sort?
commencer à apprendre
O(nlog n)
Which of the following is incorrect about randomized quicksort?
commencer à apprendre
it cannot have a time complexity of O(n^2) in any case
What is the worst case time complexity of randomized quicksort?
commencer à apprendre
O(n^2)
Using division method, in a given hash table of size 157, the key of value 172 be placed at position ____
commencer à apprendre
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
commencer à apprendre
True
What is the average retrieval time when n keys hash to the same slot?
commencer à apprendre
Theta(n)
What is a hash table?
commencer à apprendre
A data structure used to store key-value pairs
How does a hash table work?
commencer à apprendre
It uses a hash function to map keys to array indices
What is the time complexity of inserting an element in a hash table?
commencer à apprendre
O(1)
What is the worst-case time complexity of searching for an element in a hash table?
commencer à apprendre
O(n)
What happens if two keys hash to the same index in a hash table?
commencer à apprendre
A collision occurs
Depth First Search is equivalent to which of the traversal in the Binary Trees?
commencer à apprendre
Pre-order Traversal
Time Complexity of DFS is? (V – number of vertices, E – number of edges)
commencer à apprendre
O(V + E)
The Data structure used in standard implementation of Breadth First Search is?
commencer à apprendre
Queue
The Depth First Search traversal of a graph will result into?
commencer à apprendre
Tree
When the Depth First Search of a graph is unique?
commencer à apprendre
When the graph is a Linked List
In Depth First Search, how many times a node is visited?
commencer à apprendre
Equivalent to number of indegree of the node

Vous devez vous connecter pour poster un commentaire.