Академический Документы
Профессиональный Документы
Культура Документы
a. Insertion sort
b b. Selection sort
c. Bubble sort
d Merge sort
Q2. If the given input array is sorted or nearly sorted, which of the following algorithm gives the
best performance?
a a. Insertion sort
b. Selection sort
c. Quick sort
d Merge sort
a a. Merge sort
b. Typical in-place quick sort
c. Heap sort
d Selection sort
a. Selection sort
b. Heap sort
c. Quick sort
d d Merge sort
Q5. Which of the following algorithm pays the least attention to the ordering of the elements in the
input list?
a. Insertion sort
B b. Selection sort
c. Quick sort
d None
Q6. Consider the situation in which assignment operation is very costly. Which of the following
sorting algorithm should be performed so that the number of assignment operations is
minimized in general?
a. Insertion sort
b b. Selection sort
c. Heap sort
d None
A a. Divide-and-conquer
b. Backtracking
c. Heuristic approach
d Greedy approach
Q8. In full binary search tree every internal node has exactly two children. If there are 100 leaf
nodes in the tree, how many internal nodes are there in the tree?
a. 25
b b. 49
c. 99
d 101
Q9. Which type of traversal of binary search tree outputs the value in sorted order?
a. Pre-order
b. In-order
C c. Post-order
d None
Q10. If a node having two children is to be deleted from binary search tree, it is replaced by its
a. In-order predecessor
b b. In-order successor
c. Pre-order predecessor
d None
Q11. A binary search tree is formed from the sequence 6, 9, 1, 2, 7, 14, 12, 3, 8, 18. The minimum
number of nodes required to be added in to this tree to form an extended binary tree is?
a. 3
b. 6
c. 8
d d 11
Q12. When a binary tree is converted in to an extended binary tree, all the nodes of a binary tree in
the external node becomes
A a. Internal nodes
b. External nodes
c. Root nodes
d None
Q13. A binary search tree is generated by inserting in order the following integers:
50, 15, 62, 5, 20, 58, 91, 3, 8, 37, 60, 24
The number of the node in the left sub-tree and right sub-tree of the root, respectively, is
a. (4, 7)
b b. (7, 4)
c. (8, 3)
d (3, 8)
Q15. A linear collection of data elements where the linear node is given by means of pointer is
called?
A a. Linked list
b. Node list
c. Primitive list
d None
Q16. Which of the following operations is performed more efficiently by doubly linked list than by
singly linked list?
a. Insertion sort
b. Radix sort
c. Polynomial manipulation
D d Binary search
Q18. A linear list of elements in which deletion can be done from one end (front) and insertion can
take place only at the other end (rear) is known as a ?
A a. Queue
b. Stack
c. Tree
d Linked list
Q19. The data structure required for Breadth First Traversal on a graph is?
a. Stack
b. Array
C c. Queue
d Tree
Q20. Let the following circular queue can accommodate maximum six elements with the following
data
front = 2 rear = 4
queue = _______; L, M, N, ___, ___
What will happen after ADD O operation takes place?
A a. front = 2 rear = 5
queue = ______; L, M, N, O, ___
b. front = 3 rear = 5
queue = L, M, N, O, ___
c. front = 3 rear = 4
queue = ______; L, M, N, O, ___
d front = 2 rear = 4
queue = L, M, N, O, ___
Q21. A queue is a ?
Q22. In Breadth First Search of Graph, which of the following data structure is used?
a. Stack
B b. Queue
c. Linked list
d None
Q23. If the elements “A”, “B”, “C” and “D” are placed in a queue and are deleted one at a time, in
what order will they be removed?
A a. ABCD
b. DCBA
c. DCAB
d ABCD
Q24. In linked list implementation of a queue, where does a new element be inserted?
Q25. In the array implementation of circular queue, which of the following operation take worst case
linear time?
a. Insertion
b. Deletion
c. To empty a queue
D d None
Q26. In linked list implementation of queue, if only front pointer is maintained, which of the
following operation take worst case linear time?
a. Insertion
b. Deletion
c. To empty a queue
D d Both a) and c)
Q27. A circular queue is implemented using an array of size 10. The array index starts with 0, front is
6, and rear is 9. The insertion of next element takes place at the array index.
A a. 0
b. 7
c. 9
d 10
Q28. If the MAX_SIZE is the size of the array used in the implementation of circular queue, array
index start with 0, front point to the first element in the queue, and rear point to the last
element in the queue. Which of the following condition specify that circular queue is EMPTY?
a. Front=rear=0
B b. Front= rear=-1
c. Front=rear+1
d Front=(rear+1)%MAX_SIZE
Q29. A data structure in which elements can be inserted or deleted at/from both the ends but not in
the middle is?
a. Queue
b. Circular queue
C c. Dequeue
d Priority queue
Q30. In linked list implementation of a queue, front and rear pointers are tracked. Which of these
pointers will change during an insertion into a NONEMPTY queue?
Q31. The postfix form of the expression (A+ B)*(C*D- E)*F / G is?
Q32. The data structure required to check whether an expression contains balanced parenthesis is?
A a. Stack
b. Queue
c. Array
d Tree
Q33. What data structure would you mostly likely see in a non recursive implementation of a
recursive algorithm?
a. LinkList
B b. Stack
c. Queue
d Tree
Q34. The process of accessing data stored in a serial access memory is similar to manipulating data
on a ------?
a. Heap
b. Binary Tree
c. Array
D d Stack
a. *AB/CD+
B b. AB*CD/+
c. A*BC+/D
d ABCD+/*
Q36. Which data structure is needed to convert infix notation to postfix notation?
a. Branch
b. Tree
c. Queue
D d Stack
a. -/*⋀ACBDE
b. -ABCD*⋀DE
C c. -A/B*C⋀DE
d -A/BC*⋀DE
a. + pq - *rt
b. - +pqr * t
C c. - +pq * rt
d - + * pqrt
a. Queue
B b. Stack
c. Array
d List
a. 600
B b. 350
c. 650
d 588
Q42. Convert the following infix expressions into its equivalent postfix expressions
(A + B ⋀D)/(E - F)+G
A a. (A B D ⋀ + E F - / G +)
b. (A B D +⋀ E F - / G +)
c. (A B D ⋀ + E F/- G +)
d None
Q43. Convert the following Infix expression to Postfix form using a stack
x + y * z + (p * q + r) * s, Follow usual precedence rule and assume that the expression is legal.
A a. xyz*+pq*r+s*+
b. xyz*+pq*r+s+*
c. xyz+*pq*r+s*+
d none
Q44. Which of the following statement(s) about stack data structure is/are NOT correct?
Q45. Consider the linked list implementation of a stack. Which of the following node is considered as
Top of the stack?
A a. First node
b. Last node
c. Any node
d Middle node
A a. 1
b. 2
c. 3
d 4
Q47. Which of the following operation take worst case linear time in the array implementation of
stack?
a. Push
b. Pop
c. IsEmpty
D d None
Q48. The type of expression in which operator succeeds its operands is?
a. Infix Expression
b. pre fix Expression
C c. postfix Expression
d None
A a. 8
b. 9
c. 10
d 11
Q51. What is the minimum number of stacks of size n required to implement a queue of size n?
a. One
B b. Two
c. Three
d Four
Q52. If the elements “A”, “B”, “C” and “D” are placed in a stack and are deleted one at a time, in
what order will they be removed?
a. ABCD
B b. DCBA
c. DCAB
d ABDC
Q53. Consider the usual implementation of parentheses balancing program using stack. What is the
maximum number of parentheses that will appear on stack at any instance of time during the
analysis of ( ( ) ( ( ) ) ( ( ) ) )?
a. 1
b. 2
C c. 3
d 4
a. Queue
b. Graph.
C c. Stack
d Tree.
Q55. A binary tree stored using linked representation can be converted to its mirror image by
traversing it in
a. Inorder
B b. Preorder
c. Postorder
d Any order
a. +AB-*CD
b. -+A B C * D
C c. -+A B * C D
d - + *ABCD
a. n*(n-2)
b. n*(n-1)
C c. n*(n-1)/2
d n*(n-1)*(n-2)
Q58. The largest and the second largest number from a set of n distinct numbers can be found in
A a. O (n)
b. O (2n)
c. O(2)n
d O (log n)
Q59. The keys 12, 18, 13, 2, 3, 23, 5 and 15 are inserted into an initially empty hash table of length 10
using open addressing with hash function h(k) = k mod 10 and linear probing. What is the
resultant hash table?
a. A
b. B
c. C
d D
Q60. A binary tree with 45 internal nodes has _________ links to external nodes.
a. 44
b. 45
C c. 46
d 90
Q61. A binary tree with 45 internal nodes has _________ links to external nodes.
a. Root
B b. Leaf
c. Child
d Branch
Q62. Which of the following algorithms can be used to most efficiently determine the presence of a
cycle in a given graph ?
Q64. What are the appropriate data structures for following algorithms?
1) Breadth First Search
2) Depth First Search
3) Prim's Minimum Spanning Tree
4) Kruskal' Minimum Spanning Tree
a. 1) Stack
2) Queue
3) Priority Queue
4) Union Find
B b. 1) Queue
2) Stack
3) Priority Queue
4) Union Find
c. 1) Stack
2) Queue
3) Union Find
4) Priority Queue
d 1) Priority Queue
2) Queue
3) Stack
4) Union Find
Q65. The Breadth First Search algorithm has been implemented using the queue data structure. One
possible order of visiting the nodes of the following graph is
a. MNOPQR
b. NQMPOR
C c. QMNPRO
d QMNPOR
a. Strings
b. Lists
c. Stacks
D d Tree
A a. Data Structure
b. Data arrangement
c. Data configuration
d Data formation
A a. Multidimensional array
b. Linear array
c. Two dimensional array
d Three dimensional array
Q70. A ........................ does not keep track of address of every element in the list.
a. Stack
b. String
C c. Linear array
d Queue
Q71. When does top value of the stack changes?
a. Before deletion
b. While checking underflow
c. At the time of deletion
D d After deletion
Q73. . A linear collection of data elements where the linear node is given by means of pointer is
called?
A a. Linked list
b. Node list
c. Primitive list
d None
Q74. Which of the following operations is performed more efficiently by doubly linked list than by
singly linked list?
Q75. Consider an implementation of unsorted singly linked list. Suppose it has its representation with
a head and tail pointer. Given the representation, which of the following operation can be
implemented in O(1) time?
i) Insertion at the front of the linked list
ii) Insertion at the end of the linked list
iii) Deletion of the front node of the linked list
iv) Deletion of the last node of the linked list
a. I and II
b. I and III
C c. I,II and III
d I,II and IV
Q76. A variant of linked list in which last node of the list points to the first node of the list is?
a. Singly linked list
b. Doubly linked list
C c. Circular linked list
d Multiply linked list
Q78. What kind of linked list is best to answer question like “What is the item at position n?”
Q79. Which of the following statements about linked list data structure is/are TRUE?
a. Addition and deletion of an item to/ from the linked list require
modification of the existing pointers
B b. The linked list pointers do not provide an efficient way to search
an item in the linked list
c. Linked list pointers always maintain the list in ascending order
d The linked list data structure provides an efficient way to find
kth element in the list
Q80. Linked lists are not suitable to for the implementation of?
a. Insertion sort
b. Radix sort
c. Polynomial manipulation
D d Binary search
a. floor address
B b. foundation address
c. first address
d base address
Q82. The memory address of fifth element of an array can be calculated by the formula
A a. linear arrays
b. linked lists
c. both of above
d none of above
Q84. Which of the following is not the required condition for binary search algorithm?
a. tables arrays
b. matrix arrays
C c. both of above
d none of above
Q87. A variable P is called pointer if
Q88. Which of the following data structure can't store the non-homogeneous data elements?
A a. Arrays
b. Records
c. Pointers
d None
Q89. Which of the following data structure store the homogeneous data elements?
a. Arrays
B b. Records
c. Pointers
d None
Q90. Each data item in a record may be a group item composed of sub-items; those items which are
indecomposable are called
a. elementary items
b. atoms
c. scalars
D d all of above
Q94. When new data are to be inserted into a data structure, but there is no available space; this
situation is usually called
a. underflow
B b. overflow
c. houseful
d saturated
A a. underflow
b. overflow
c. housefull
d saturated
A a. FIFO lists
b. LIFO list
c. Piles
d Push-down lists
Q98. The term "push" and "pop" is related to the
a. array
b. lists
C c. stacks
d all of above
Q99. A data structure where elements can be added or removed at either end but not in the middle
a. Linked lists
b. Stacks
c. Queues
D d Deque
Q100. When inorder traversing a tree resulted E A C K F H D B G; the preorder traversal would return
a. FAEKCDBHG
B b. FAEKCDHGB
c. EAFKHDCBG
d FEAKDCHBG
Q103. . The height of a BST is given as h. Consider the height of the tree as the no. of edges in the
longest path from root to the leaf. The maximum no. of nodes possible in the tree is?
a. 2h-1 -1
B b. 2h+1 -1
c. 2h +1
d 2h-1 +1
Q104. The no of external nodes in a full binary tree with n internal nodes is?
a. n
B b. n+1
c. 2n
d 2n + 1
Q105. The difference between the external path length and the internal path length of a binary tree
with n internal nodes is?
a. 1
b. n
c. n+1
D d 2n
Q106. Suppose a binary tree is constructed with n nodes, such that each node has exactly either zero
or two children. The maximum height of the tree will be?
a. (n+1)/2
B b. (n-1)/2
c. n/2 -1
d (n+1)/2 -1
Q108. Suppose we have numbers between 1 and 1000 in a binary search tree and want to search for
the number 363. Which of the following sequence could not be the sequence of the node
examined?
a. 25
b. 49
c. 99
d 101
Q110. Which type of traversal of binary search tree outputs the value in sorted order?
a. Pre-order
B b. In-order
c. Post-order
d None
Q111. Suppose a complete binary tree has height h>0. The minimum no of leaf nodes possible in term
of h is?
a. 2h -1
b. 2h -1 + 1
C c. 2h -1
d 2h +1
Q113. If a node having two children is to be deleted from binary search tree, it is replaced by its
a. In-order predecessor
B b. In-order successor
c. Pre-order predecessor
d None
Q114. A binary search tree is formed from the sequence 6, 9, 1, 2, 7, 14, 12, 3, 8, 18. The minimum
number of nodes required to be added in to this tree to form an extended binary tree is?
a. 3
b. 6
c. 8
d 11
Q115. In a full binary tree, every internal node has exactly two children. A full binary tree with 2n+1
nodes contains
a. n leaf node
B b. n internal nodes
c. n-1 leaf nodes
d n-1 internal nodes
Q116. the run time for traversing all the nodes of a binary search tree with n nodes and printing them
in an order is
a. O(nlg(n))
B b. O(n)
c. O(√n)
d O(log(n))
Q117. When a binary tree is converted in to an extended binary tree, all the nodes of a binary tree in
the external node becomes
A a. Internal nodes
b. External nodes
c. Root nodes
d None
Q118. If n numbers are to be sorted in ascending order in O(nlogn) time, which of the following tree
can be used
a. Binary tree
b. Binary search tree
c. Max-heap
D d Min-heap
A a. FILO
b. FIFO
c. LILO
d Both a and c above
Q120. An empty list is the one which has no
a. nodes
b. data
C c. both a and b above
d address
Q121. In a heap, element with the greatest key is always in the ______________ node
a. leaf
B b. root
c. first node of left sub tree
d first node of right sub tree
Q122. A _____________ tree is tree where for each parent node, there is only one associated child
node
A a. random
b. order of priority
c. as and when they come
d none of the above
a. False
B b. True
Q125. In graphs, A hyper edge is an edge that is allowed to take on any number of ______
a. Vertices
B b. Edges
c. Both a and b above
d Labels
Q126. Key value pairs is usually seen in
A a. Hash tables
b. Heaps
c. Both a and b
d Skip list
a. Binary trees
b. Stacks
C c. Graphs
d Both a and c above
ANSWERS :