Time Left - 15:00 mins

GATE CS 2021 : Data Structure and programming Rapid Quiz-1 (App update required to attempt this test)

Attempt now to get your rank among 579 students!

Question 1

Which of the following is a correct formula to find the location of an upper or a lower triangular matrix elements in a array Loc[] whch is stored efficiently.

BA is the base address , c is the element size in the system, LB1 and LB2 are lower bounds for rows and columns respectively. UB1 and UB2 are the upper bounds for rows and columns respectively.

Question 2

Suppose you are given a doubly linked list containing n (n>=1) nodes. You need to transfer the content of this starting from the head list to a stack. Stack is implemented with array having top element “top” initialized to 0. Find the minimum number of operations done on the linked list such that after the operation is completed linked list remains undisturbed. Operations include loop initialization, loop increment /decrement, loop condition, transferring of data etc.

Question 3

Consider the creation of a binary search tree for a set of keys that may have multiple copies of some keys. We create the tree by repeated insertion. For inserting distinct values, the usual insertion procedure is followed. However, while inserting second and subsequent copies of a key, we always move to the right child of the first copy. The height of the binary search tree we obtain when we insert [28,15,15,15,28,17,28,16,15,55,13,15,35,10,13,28] in that order is _______

[Note: if the tree having only one node we will treat height of a tree is zero]

Question 4

Consider generating Binary Search trees using a given set of numbers in the following order. Which of the following sequence of numbers will result in a tree that is strictly binary tree, i.e., every node has either two children or no children?

Question 5

Number of BSTs possible with 6 keys are

Question 6

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 :
  • 579 attempts
  • 4 upvotes
  • 4 comments
May 10GATE & PSU CS