NEW
Font size
Worksheets6th March
Total questions: 10
Worksheet time: 4mins
in the tower of hanoi problem which disk is shifted first
Bottom one
Top one
N-1 th Disk
none of the options are correct
Consider a definition of mystery():
mystery(0,N) = N
mystery(P,Q) = mystery(P-1, Q+1)
According to this definition, what is mystery(2,4)?
3
4
5
6
What will be the output of the code?
Print First 3
Print First 2
Print First 1
Print Last 2
Print Last 3
Print Last 4
Print First 1
Print First 2
Print First 3
Print Last 2
Print Last 3
Print Last 4
Print First 3
Print First 2
Print First 1
Print Last 1
Print Last 2
Print Last 3
Print First 3
Print First 2
Print First 1
Print Last 1
Print Last 3
Print Last 4
The depth of a complete binary tree is given by
Dn = log2n+1
Dn = n log2n+1
Dn = n log2n
Dn = log2n
What is the time complexity of level order traversal?
O(1)
O(n)
O(logn)
O(nlogn)
In backtracking, what is the difference between a feasible solution and an optimal solution?
A feasible solution is correct, while an optimal solution is the best possible solution
A feasible solution is a valid solution, while an optimal solution is the most efficient solution
A feasible solution satisfies all the constraints, while an optimal solution maximizes or minimizes an objective function
There is no difference between a feasible solution and an optimal solution in backtracking
Which of the following is not an advantage of using a red-black tree over a binary search tree?
O(log n) time complexity for search, insert, and delete operations
Guaranteed worst-case height of O(log n)
Guaranteed balance of the tree
Guaranteed best-case height of O(log n)
Which of the following data structures is used to implement Prim's algorithm?
Stack
Queue
Heap
Linked List
In digial signatures which of the following algorithms are used
public key cryptography and Hashing
Hashing
Symmetric key cryptography and Hashing
public key cryptography and Symmetric key cryptography
