Time Left - 12:00 mins
ISRO CS 2019 : DS Booster Quiz 4
Attempt now to get your rank among 494 students!
Question 1
Consider a binary tree with the following conditions :
* The elements present in left sub-tree of a specific node are smaller than that node and elements present in right sub-tree of a specific node are greater than that node.
* The tree is always balanced i.e. the height of left sub-tree and right sub-tree is approximately same. (maximum differ by 1)
What is the worst case time complexity to run membership test for an element on this tree ?
Question 2
One of the application of DFT is to check whether a vertex is articulation point or not. So in a graph with V vertices and E edges, what is the time taken to check whether a specific vertex is articulation point or not :
Question 3
Suppose we want to search for an element 70 in a Binary Search tree. Which of the following probe sequences are not valid while searching a Binary Search tree?
Question 4
Consider a BST with some extra features added to it in order to improve its data storing efficiency. After adding those features , the time complexity of the basic operations in BST like insertion , deletion or searching may change. Now consider the following two features added :
• BST is always made balanced
• Splaying : Bringing the recently accessed element to root
Now after adding these two features BST is modified Which of the following statements are true regarding the modified BST :
I. Worst case searching time = O(logn)
II. Worst case searching time = O(1)
III. Locality of reference is achieved
IV. Insertion/Deletion time in modified BST is more than in ordinary BST
V. Splaying has added an extra time of O(n)
• BST is always made balanced
• Splaying : Bringing the recently accessed element to root
Now after adding these two features BST is modified Which of the following statements are true regarding the modified BST :
I. Worst case searching time = O(logn)
II. Worst case searching time = O(1)
III. Locality of reference is achieved
IV. Insertion/Deletion time in modified BST is more than in ordinary BST
V. Splaying has added an extra time of O(n)
Question 5
Consider a linked list as :
Now consider a direct pointer P is given to node with value 'd'. We want to delete the node pointed by P . How much time it will take if the length of linked list is assumed to be n.
Now consider a direct pointer P is given to node with value 'd'. We want to delete the node pointed by P . How much time it will take if the length of linked list is assumed to be n.
Question 6
Match the following :
Question 7
Consider the following function recursion(a, b). What is the value of recursion( 8,6)?
int recursion(int a, int b)
{
if (a == 0)
return b;
return recursion( a -1, a + b);
}
int recursion(int a, int b)
{
if (a == 0)
return b;
return recursion( a -1, a + b);
}
Question 8
What will be value after postfix evaluation of:
a+b*c^d/e+f
a+b*c^d/e+f
Question 9
In a sequential representation of a binary tree in memory, let TREE be an array which is linear in nature. If any Node N occupies the position TREE[K] then its left child is stored in and it is right child is stored in-
Question 10
Consider the Pre-order traversal of a Binary Search Tree :
100, 80, 50, 40, 45, 60, 70, 90, 110, 120
Construct the BST from the given data and find the post-order traversal.
100, 80, 50, 40, 45, 60, 70, 90, 110, 120
Construct the BST from the given data and find the post-order traversal.
- 494 attempts
- 6 upvotes
- 6 comments
Oct 10GATE & PSU CS