Persistent Previous Years Solved Sample Placement Papers
-
What is the best-case height of a B-tree of order n and which has k keys?
A) logn (k+1) – 1 (Ans)
B) nk
C) logk (n+1) – 1
D) klogn
-
Compression techniques can be used on the keys to reduce both space and time requirements in a B-tree.
A) True (Ans)
B) False
-
Why is the heap implemented using array representations rather than tree (linked list) representations though both have the same complexities?
A) Arrays can store trees that are complete and heaps are not complete
B) List representation takes more memory, hence memory efficiency is less. Go with arrays because arrays have better caching (Ans)
C) Lists have better caching
D) In lists, insertion and deletion are difficult
-
Can a tree stored in an array using either one of inorder, postorder, or preorder traversals be reformed?
A) Yes, just traverse through the array and form the tree
B) No, we need one more traversal to form a tree (Ans)
C) No, in case of sparse trees
D) Yes, by using both inorder and array elements
-
What data structure is used when converting an infix notation to prefix notation?
(a) Stack
(b) Queue
(c) B-Trees
(d) Linked-list
Answer: (a)
Explanation: To convert infix to prefix, reverse the equation and use the infix-to-postfix algorithm. This process utilizes stacks for operator precedence and association. -
What would be the Prefix notation for the given equation?
a+b-c/d&e|f
(a) |&-+ab/cdef
(b) &|-+ab/cdef
(c) |&-ab+/cdef
(d) |&-+/abcdef
Answer: (a)
Explanation: Reverse the equation or scan from right to left. The precedence order is| & + /
. Operators are pushed and popped based on precedence, resulting in|&-+ab/cdef
. -
What would be the Prefix notation for the given equation?
(a+(b/c)*(d^e)-f)
(a) -+a*/^bcdef
(b) -+a*/bc^def
(c) -+a*b/c^def
(d) -a+*/bc^def
Answer: (b)
Explanation: Reverse the equation or scan from right to left. Solve equations within brackets first. The precedence order is+*/^
, resulting in-+a*/bc^def
. -
What would be the Prefix notation and Postfix notation for the given equation?
A+B+C
(a) ++ABC and AB+C+
(b) AB+C+ and ++ABC
(c) ABC++ and AB+C+
(d) ABC+ and ABC+
Answer: (a)
Explanation: Prefix notation places operators before their operands, resulting in++ABC
. Postfix notation places operators after their operands, resulting inAB+C+
. -
Which is not a sorting method?
A: Heap sort
B: Quick sort
C: Shell sort
D: Linear sort
Ans: D -
The memory address of element A[i][j] in row-major order is:
A: loc(A[i][j]) = base(A) + W((i-LB) + n(j-LB))
B: loc(A[i][j]) = base(A) + W(n(j-LB) + (i-LB))
C: loc(A[j][i]) = base(A) + W(n(I-LB) + n(j-LB))
D: loc(A[i][j]) = base(A) + W((I-LB) + n(j-LB))
Ans: B -
The memory address of elements A[i][j] in column-major order is:
A: loc(A[i][j]) = base(A) + W((I-LB) + m(j-LB))
B: loc(A[i][j]) = base(A) + W(m(j-LB) + (i-LB))
C: loc(A[j][i]) = base(A) + W(n(I-LB) + m(j-LB))
D: loc(A[i][j]) = base(A) + W((I-LB) + m(j-LB))
Ans: B -
The base address of an array is the address of:
A: A[1]
B: A[n1]
C: A[0]
D: Both A and B
Ans: C -
Which data structure is used to implement queues, trees, graphs?
A: Stack
B: List
C: Array
D: None
Ans: C -
In which data structure do addition and deletion of elements take place from the same position?
A: Stack
B: List
C: Array
D: Queue
Ans: A -
In stack, the end is commonly referred to as:
A: Top
B: Bottom
C: Rear
D: Front
Ans: A