Alogorithm and DS PG DAC - Aug 19
Alogorithm and DS PG DAC - Aug 19
Alogorithm and DS PG DAC - Aug 19
Q2. Deleting a node in a linked list is a simple matter of using the delete operator to free the node’s memory
a) True b) False
Q4. Which one of the following algorithm is NOT an example of Divide and conquer
technique a) Quick Sort b) Merge Sort c) Bubble Sort d) Binary Search
Q5. The inorder traversal of some binary tree produces the sequence DBEAFC, and the postorder transversal of
the same tree produced the sequence DEBFCA. Which of the following is correct preorder transversal
sequence?
a) DBAECF b) ABEDFC c) ABDECF d) None of the above
Q11. The end at which a new element gets added to queue is called
a) Front b) Rear c) Top d) Bottom
1
USM’s Shriram Mantri Vidyanidhi Info Tech Academy
PG DAC Aug 19 Data Structure Question Bank
Q13. A graph is said to be a tree, if it satisfies which of the properties:
a) If it is connected and there are no cycles in the graph.
a) If it is not connected and there are cycles in the graph
b) If it connected and there are cycles in the graph
c) None of the above
Q15. The inorder traversal of some binary tree produces the sequence DBEAFC, and the postorder
traversal of the same tree produced the sequence DEBFCA. Which of the following is a correct preorder
traversal sequence?
a) DBAECF b) ABEDFC c) ABDECF d) None of the above
Q16. Which of the following is not an operation of queue, assuming that queue has items `Q` and `X`?
a) empty(Q) b) deque(Q,X) c) enque(Q,X) d) push(Q,X)
Q18. A dynamic data structure where we can search for desired records in O(log2n) time is
a) heap b) binary search tree c) circularly linked list d) array
Q20. The five items: A, B, C, D and E are pushed in a stack, one after the other starting from A. The stack is
popped four times and each element is inserted in a queue. Then two elements are deleted from the queue and
pushed back on the stack. Now one item is popped from the stack. The popped item is.
a) A b) B c) C d) D
Q22. The memory address of fifth element of an array can be calculated by the formula
a. LOC(Array[5]=Base(Array)+w(5-lower bound), where w is the number of words per memory cell for the
array
b. LOC(Array[5])=Base(Array[5])+(5-lower bound), where w is the number of words per memory cell for the
array
c. LOC(Array[5])=Base(Array[4])+(5-Upper bound), where w is the number of words per memory cell for the arr
d. d. None of above
2
USM’s Shriram Mantri Vidyanidhi Info Tech Academy
PG DAC Aug 19 Data Structure Question Bank
Q23. Which of the following data structures are indexed structures?
a) linear arrays b) linked lists c) both of above d) none of above
Q24. Which of the following is not the required condition for binary search
algorithm? a) The list must be sorted
b) there should be the direct access to the middle element in any sublist
c) There must be mechanism to delete and/or insert elements in list d) none of above
Q28. Which of the following data structure can't store the non-homogeneous data elements?
a) Arrays b) Records c) Pointers d) None
Q30. 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) all of above
3
USM’s Shriram Mantri Vidyanidhi Info Tech Academy
PG DAC Aug 19 Data Structure Question Bank
Q33. Binary search algorithm cannot be applied to
a) sorted linked list b) sorted binary trees c) sorted linear array d) pointer array
Q34. 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) overflow c) housefull d) saturated
Q39. 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) Deque
Q40. When inorder traversing a tree resulted E A C K F H D B G; the preorder traversal would return
a) FAEKCDBHG b) FAEKCDHGB c) EAFKHDCBG d) FEAKDCHBG
Q41. Which data structure allows deleting data elements from front and inserting at rear?
a) Stacks b) Queues c) Deques d) Binary search tree
Q42. Identify the data structure which allows deletions at both ends of the list but insertion at only one end.
a) Input-restricted deque b) Output-restricted deque c) Priority queues d) None of above
Q45. To represent hierarchical relationship between elements, which data structure is suitable?
a) Deque b) Priority c) Tree d) All of above
Q46. A binary tree whose every node has either zero or two children is called
a) Complete binary tree b) Binary search tree c) Extended binary tree d) None of above
4
USM’s Shriram Mantri Vidyanidhi Info Tech Academy
PG DAC Aug 19 Data Structure Question Bank
Q47. The depth of a complete binary tree is given by
a) Dn = n log2n b) Dn = n log2n+1 c) Dn = log2n d) Dn = log2n+1
Q48. When representing any algebraic expression E which uses only binary operations in a 2-tree,
a) the variable in E will appear as external nodes and operations in internal nodes
b) the operations in E will appear as external nodes and variables in internal nodes
c) the variables and operations in E will appear only in internal nodes
d) the variables and operations in E will appear only in external nodes
Q50. When converting binary tree into extended binary tree, all the original nodes in binary tree
are a) internal nodes on extended tree b) external nodes on extended tree
c) vanished on extended tree d) None of above
Q51. The post order traversal of a binary tree is DEBFCA. Find out the pre order traversal
a) ABFCDE b) ADBFEC c) ABDECF d) ABDCEF
Q54. In a binary tree, certain null entries are replaced by special pointers which point to nodes higher in the tree
for efficiency. These special pointers are called
a) Leaf b) branch c) path d) thread
Q55. The in order traversal of tree will yield a sorted listing of elements of tree in
a) Binary trees b) Binary search trees c) Heaps d) None of above
5
USM’s Shriram Mantri Vidyanidhi Info Tech Academy
PG DAC Aug 19 Data Structure Question Bank
Q58. A connected graph T without any cycles is called
a) a tree graph b) free tree c) a tree d) All of above
Q62. The time factor when determining the efficiency of algorithm is measured by
a) Counting microseconds b) Counting the number of key operations
c) Counting the number of statements d) Counting the kilobytes of algorithm
Q63. The space factor when determining the efficiency of algorithm is measured
by a) Counting the maximum memory needed by the algorithm
b) Counting the minimum memory needed by the algorithm
c) Counting the average memory needed by the algorithm
d) Counting the maximum disk space needed by the algorithm
Q64. Which of the following case does not exist in complexity theory
a) Best case b) Worst case c) Average case d) Null case
6
USM’s Shriram Mantri Vidyanidhi Info Tech Academy
PG DAC Aug 19 Data Structure Question Bank
Q68. The complexity of linear search algorithm is
a) O(n) b) O(log n) c) O(n2) d) O(n log n)
Q72. The indirect change of the values of a variable in one module by another module is called
a) internal change b) inter-module change c) side effect d) side-module update
Q73. Which of the following data structure is not linear data structure?
a) Arrays b) Linked lists c) Both of above d) None of above
Q80. Each array declaration need not give, implicitly or explicitly, the information about
a) the name of array b) the data type of array
c) the first data from the set to be stored d) the index set of the array
7
USM’s Shriram Mantri Vidyanidhi Info Tech Academy
PG DAC Aug 19 Data Structure Question Bank
Q81. The elements of an array are stored successively in memory cells because
a) by this way computer can keep track only the address of the first element and the addresses of other elements
can be calculated
b) the architecture of computer memory does not allow arrays to store other than serially
c) both of above
d) none of above
Q84. Queue-full condition for the circular queue represented sequentially is?
a) front = = rear b) rear + 1 + front c) (rear+1)%arraysize = = front d) None of the these
Q.87 The link field of last node, in a singly link list representation is linked with
a) The data field of the first node b) The link field of the first node
c) A null d) The link field of the prior node
Q88. Which of the following is not true regarding a singly linked list?
a) Nodes are linked in one direction
b) The last node is pointing to NULL indicating the end of list
c) Searching for a node always starts at the first node and traverses through every subsequent nodes
d) Address of the list is the address of the node
Q89. The header of main function which takes command line arguments looks like ___________
a) Int main(int argc, char *argv) b) Int main(char *argv, int argc)
c) Int main(int argc, char *argv[]) d) Int main(char *argv[],int argc)
Q90. Using which macro, we can display the argument from variable number of argument function?
a) va_arg b) va_list c) va_show d) va_start
8
USM’s Shriram Mantri Vidyanidhi Info Tech Academy
PG DAC Aug 19 Data Structure Question Bank
Q91. what will be the output of the following program?
#include <stdio.h>
Int main()
{
float arr[]={12.5,5.4,7.3,21.6,8.7};
printf(“%d\n”,sizeof(arr)/sizeof(arr[0]));
return 0;
}
a) 4 b) 5 c) 8 d) 20
Q93. A program P reads in 500 integers in the range [0 to 100] representing the score of 500 students. It then
prints the frequency of each score above 50. What would be the best way for P to store the frequencies?
a) An array of 50 numbers b) An array of 100 numbers
c) An array of 500 numbers d) A dynamically allocated array of 550 numbers
9
USM’s Shriram Mantri Vidyanidhi Info Tech Academy
PG DAC Aug 19 Data Structure Question Bank
const int* Sample()
{
return (&a);
}
a) Warning b) compilation error c) output : 124 d) garbage value
Q99. Which out of the given function types cannot be declared “virtual”?
a) Normal member functions b) Constructor c) Destructor d) None of the above
10
USM’s Shriram Mantri Vidyanidhi Info Tech Academy
PG DAC Aug 19 Data Structure Question Bank
Q104. Which of the following STL Container will store the elements in adjacent memory locations?
a) Vector b) list c) set d) map
Q107. In which operator overloading, compiler implicitly passes a dummy integer as an argument?
a) Post increment / decrement operator b) Pre increment / decrement operator
c) Both the above d) None of the above
Q112. Which of the following data structure may give overflow error, even though the current number of
element in it is less than its size?
a) Simple queue b) Circular queue c) Primary queue d) Stack
Q113. The most appropriate matching for the following pairs:
a) Bubble sort 1) O(nlog(n))
11
USM’s Shriram Mantri Vidyanidhi Info Tech Academy
PG DAC Aug 19 Data Structure Question Bank
b) Insertion sort 2) O(n)
c) Quick sort 3) O(n^2)
a) a=1 b=2 c=3 b) a=3 b=1 c=2 c) a=3 b=2 c=1 d) a=2 b=3 c=1
Q114. In a binary tree, certain null entries are replaced by special pointers which point to nodes higher in the
tree for efficiency. These special pointers are called ______
a) root b) node c) branch d) thread
Q115. a binary search tree whose left subtree and right subtree differ in height by at most one unit is called.
a) AVL tree b) Red-black tree c) Lemma tree d) None of the above
Q117. Which of the following stack operations could result in stack underflow?
a) Push b) pop c) is_full d) none of the above
Q118. Which of the following sorting algorithm has the worst time complexity of nlog(n)?
a) Heap sort b) Insertion sort c) Selection sort d) Bucket sort
Q119. The number of binary trees with 3 nodes which when traversed in post order gives the sequence A, B , C
is
a) 3 b) 5 c) 7 d) 9
Q120. A binary tree that has n leaf nodes, all at same level. The number of non-leaf nodes in such tree is
a) n-1 b) log(n) c) 2n d) 2n-1
Q123. Which design pattern you would use to limit the class instantiation to one object?
a) Factory method design pattern b) Builder design pattern
c) Prototype design pattern d) Singleton design pattern
Q124. The object which outlives the program execution time and exists between executions of the program is
known as______________________
a) Global object b) persistent object c) transient object d) delegate object
12
USM’s Shriram Mantri Vidyanidhi Info Tech Academy
PG DAC Aug 19 Data Structure Question Bank
Q125. Which design pattern you would use to translate an existing class interface into a compatible target
interface?
a) Proxy design pattern b) Adapter design pattern
c) Façade design pattern d) Bridge design pattern
Q126. The adapter, bridge and composite design patterns are examples of _________
a) Creational pattern b) Structural pattern
c) Behavioral pattern d) Interaction pattern
Q127. Communication diagram, sequence diagram and timing diagram can all be categorized as _________
a) Behavior diagram b) Structure diagram c) Activity diagram d) Interaction diagram
Q129. Deleting a node in a linked list is a simple matter of using the delete operator to free the node’s
memory a) True b) False
Q131. Which one of the following algorithm is NOT an example of Divide and conquer technique
a) Quick Sort b) Merge Sort c) Bubble Sort d) Binary Search
Q132. The inorder traversal of some binary tree produces the sequence DBEAFC, and the postorder transversal
of the same tree produced the sequence DEBFCA. Which of the following is correct preorder transversal
sequence?
a) DBAECF b) ABEDFC c) ABDECF d) None of the above
13
USM’s Shriram Mantri Vidyanidhi Info Tech Academy
PG DAC Aug 19 Data Structure Question Bank
a) Similar columns b) Similar rows c) Not representable d) None of the above
Q138. The end at which a new element gets added to queue is called
a) Front b) Rear c) Top d) Bottom
Q139. If we traverse a following tree in Pre order then what will be traversal
a) ABDGCEHIF b) ABDGHEICF c) ABDGFCIEH d) None of the above
Q142. The inorder traversal of some binary tree produces the sequence DBEAFC, and the postorder traversal of
the same tree produced the sequence DEBFCA. Which of the following is a correct preorder traversal sequence?
a) DBAECF b) ABEDFC c) ABDECF d) None of the above
14
USM’s Shriram Mantri Vidyanidhi Info Tech Academy
PG DAC Aug 19 Data Structure Question Bank
{
cout<<A<<”,”<<B<<”,”<<C;
return 0;
}
a) 32 , 32 , 32 b) 32 ,33 , 34 c) 32, 31 , 30 d) None of the above
Q146. A dynamic data structure where we can search for desired records in O(log2n) time is
a) heap b) binary search tree c) circularly linked list d) array
Q148. Deleting a node in a linked list is a simple matter of using the delete operator to free the node’s
memory. a) True b) False
Q149. The inorder traversal of some binary tree produces the sequence DBEAFC, and the postorder traversal of
the same tree produced the sequence DEBFCA. Which of the following is a correct preorder traversal sequence?
a) DBAECF b) ABEDFC c) ABDECF d) None of the above
Q152. Suppose the numbers 6, 4, 2,9,5,7,0,3,1 are inserted in that order into an initially empty binary search
tree. The binary search tree uses the usual ordering on natural numbers. What is the inorder traversal sequence
of the resultant tree?
Select one:
a) 7 9 6 1 0 3 2 5 4 b) 1 0 3 2 5 4 7 9 6 c) 7 9 0 1 2 3 4 5 6 d) 0 1 2 3 4 5 6 7 9
Q155. The time factor when determining the efficiency of algorithm is measured by
15
USM’s Shriram Mantri Vidyanidhi Info Tech Academy
PG DAC Aug 19 Data Structure Question Bank
a) Counting microseconds b) Counting the number of key operations,
c) Counting the number of statements d) Counting the kilobytes of algorithm
Q156. The space factor when determining the efficiency of algorithm is measured
by a) Counting the maximum memory needed by the algorithm
b) Counting the minimum memory needed by the algorithm
c) Counting the average memory needed by the algorithm
d) Counting the maximum disk space needed by the algorithm
Q157. Which of the following case does not exist in complexity theory
a) Best case b) Worst case c) Average case d) Null case
Q160. The correct order of the efficiency of the following sorting algorithms according to their overall running
time comparisons is
a) bubble>selection>insertion b) Insertion>selection>bubble
c) Merge=Quick=Heap d) none above
Q161. A sort which iteratively passes through a list to exchange the first element with any element less than it
and then repeats with a new first element is called
a) quick sort b) selection sort
Q162. The way a card game player arranges his cards as he picks them one by one can be compared to
a) Quick sort b) Insertion sort c) Selection sort d) Merge sort
Q163. Which among the following is the best when the list is already sorted
a) Merge sort b) Quick sort c) Insertion sort d) Selection sort
16
USM’s Shriram Mantri Vidyanidhi Info Tech Academy
PG DAC Aug 19 Data Structure Question Bank
Q167. An ADT is defined to be a mathematical model of a user-defined type along with the collection of all
____________ operations on that model.
a) Cardinality b) Assignment c) Primitive d) Structured
Q168. An algorithm is made up of two independent time complexities f (n) and g (n). Then the complexities of
the algorithm is in the order of
a) f(n) x g(n) b) Max ( f(n),g(n)) c) Min (f(n),g(n)) d) f(n) + g(n)
Q169. As part of the maintenance work, you are entrusted with the work of rearranging the library books in a
shelf in proper order, at the end of each day. The ideal choice will be
a) Bubble sort b) Quick sort c) Insertion sort d) Selection sort
Q171.You have a sorted array and now you are given an element to be placed in that array so that the resulting
array is also sorted, the best sorting technique in this case is
a) Bubble sort b) Selection sort c) Insertion sort d) Merge sort
Q172. The input to a merge sort is 6,5,4,3,2,1 and the same input is applied to quick sort then which is the best
algorithm in this case
a) Merge sort b) Quick sort c) Cannot be decided
Q173. The memory available for storage is less, in this case if you want to sort the data which is the better
approach amongst the following
a) Merge sort b) Quick sort c) Heap sort d) All
Q174. Arrange heap sort, merge sort and quick sort in the order of their space complexity
a) heap>merge>quick b) quick<heap<merge c) merge>quick>heap d) none
Q175. One of the reason why quick sort is better compared to other sorts is
a) its running time is O(n) b) its space complexity is theta(log n),
Q178. Which of the following statements are right about radix sort?
a) LSD radix sort is a stable sort b) MSD radix sort is a stable sort c) None.
17
USM’s Shriram Mantri Vidyanidhi Info Tech Academy
PG DAC Aug 19 Data Structure Question Bank
Q179. LSD radix sort is applied on the following set of numbers: 21,86,124,33,29,163. What will be the order of
numbers just before the MSD is considered?
a) (21,29,86,33,124,163) b) ( 21,124,29,33,163,86) c) ( 21,29,124,163,33,86)
Q180. The worst case time and worst case space complexity of radix sort is:
a) O(k*lg (N)) b) O(N^2) c) O(k*N)
Q184. Each array declaration need not give, implicitly or explicitly, the information about
a) The name of array b) The data type of array
c) The first data from the set to be stored d) The index set of the array
Q186. Which of the following is not the required condition for binary search algorithm?
a) The list must be sorted, there should be the direct access to the middle element in any sub list
b) There must be mechanism to delete and/or insert elements in list
c) none of above
18
USM’s Shriram Mantri Vidyanidhi Info Tech Academy
PG DAC Aug 19 Data Structure Question Bank
Q188. Binary search algorithm cannot be applied to
a) sorted linked list b) sorted binary trees c) sorted linear array d) pointer array
Q189. The extra key inserted at the end of the array is called a,
a) End key. b) Stop key. c) Sentinel. D) Transposition.
Q192. 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) overflow c) house full d) saturated
Q195. 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) Deque
Q196. Identify the data structure which allows deletions at both ends of the list but insertion at only one end.
a) Input-restricted deque b) Output-restricted deque
c) Priority queues d) None of above
Q200. Linked lists are best suited for relatively permanent collections of data
a) for the size of the structure and the data in the structure are constantly changing
b) for both of above situation
c) for none of above situation
19
USM’s Shriram Mantri Vidyanidhi Info Tech Academy
PG DAC Aug 19 Data Structure Question Bank
Q201. In list implementation, a node carries information regarding
a) the data b) the link c) the link and the data d) non above
Q202. The link field in the last node of the linked list contains
a) Zero value b) link to the first node
c) Pointer to the next element location d) all above
Q203. To delete a node at the beginning of the list, the location of the list is modified as the address of the.
a) second element in the list b) first element in the list
c) last element in the list d) no element
Q204. A linked list in which the last node points to the first is called a
a) Doubly linked list b) Circular list c) Generalized list d) reveres list
Q206. In the linked list representation of the stacks, the top of the stack is represented by
a) the last node b) any of the nodes c) first node d) non above
Q210. To represent hierarchical relationship between elements, which data structure is suitable?
a) Deque b) Priority c) Tree d) All of above
Q212. When inorder traversing a tree resulted E A C K F H D B G; the preorder traversal would return
a) FAEKCDBHG b) FAEKCDHGB c) EAFKHDCBG d) FEAKDCHBG
Q213. The post order traversal of a binary tree is DEBFCA. Find out the pre order traversal
a) ABFCDE b) ADBFEC c) ABDECF d) ABDCEF
20
USM’s Shriram Mantri Vidyanidhi Info Tech Academy
PG DAC Aug 19 Data Structure Question Bank
Q214. In a binary tree, certain null entries are replaced by special pointers which point to nodes higher in the
tree for efficiency. These special pointers are called
a) Leaf b) branch c) path d) thread
Q215. The in order traversal of tree will yield a sorted listing of elements of tree in
a) Binary trees b) Binary search trees c) Heaps d) None of above
Q221. The node which gives rise to the branch node is called the
a) ancestor b) grandfather c) root node
Q223. A binary tree in which every non-leaf node has non-empty right and left subtrees is said to be a
a) Strictly binary tree b) complete binary tree c) almost complete binary tree
Q225. In the sequential representation of binary tree implementation each node of the tree will have
a) no link field
b) info, left, right and father fields
c) Three fields, data and the pointers to left and right subtrees.
21
USM’s Shriram Mantri Vidyanidhi Info Tech Academy
PG DAC Aug 19 Data Structure Question Bank
Q226. An adjacency matrix representation of a graph cannot contain information of :
a) nodes b) edges c) direction of edges d) parallel edges
Q227. In Breadth First Search of Graph, which of the following data structure is
used? a) Stack. b) Queue. c) Linked List. d) None of
the above.
Q228. The binary tree in which the descendent points to the ancestor is called?
a) linked tree b) threaded tree c) pointer tree
Q229. A binary tree whose every node has either zero or two children is called:
a) Complete Binary Tree b) Binary Search Tree
c) None of the Above d) Extended Binary Tree
Q232. The initial configuration of the queue is a, b, c, d (a is the front end).To get the configuration d, c, b, a
one needs a minimum of?
a) 2 deletions and 3 additions b) 3 deletions and 4 additions
c) 3 deletions and 2 additions d) 3 deletions and 3 additions
Q233. What is the infix version of the following postfix expression? X12+z17Y +42*/+
a) x+12+z/ (17+y)*42 b) x+12+z ((17+y)*42
22
USM’s Shriram Mantri Vidyanidhi Info Tech Academy
PG DAC Aug 19 Data Structure Question Bank
c) x+12+z/17+y*42 d) x+12+z)/ (17+Y*42)
Q236. Suppose we have the following class whose underlying data structure is a linked list of of
List nodes.
class List{
public:
//other public functions
~List();
private:
struct
Listnode{
int item;
List
node *next;
};
ListNode*head;
};
Q237. Which of the following sequence of code could be used in the destructor~List () to correctly delete all of
the nodes in the list? (Which ones are legal, even if the style is atrocious?)
I. for(ListNode*n=head;head!=NULL;head=n){ n=head->next;
delete head;
}
II. for (ListNode *n=head;n!=NULL;n->next){ delete n;
}
III. ListNode*n;
Q238.
while(head!=NULL){
n=head->next; delete
head;
head=n;
}
a) I and II only b) III only c) II and III only d) and III only
23
USM’s Shriram Mantri Vidyanidhi Info Tech Academy
PG DAC Aug 19 Data Structure Question Bank
Q239. Find the output of the following program?
Main ()
{
int x=20, y=35;
x=y+++x;
cout<<x<<y;
}
a) 56, 91 b) 55, 90 c) 57, 94 d) 57, 92
Q240. The numbers of swapping needed to sort the numbers 25,23,21,22,24 in ascending order using bubble
sort is:
a) 12 b) 20 c) 6 d) 13
Q241. What is the expected time required to search for a value in a binary search tree containing n nodes?
(You should make reasonable assumptions about the structure of the tree.)
a) O(log n) b) O(n) c) O(1) d) O(n log n)
Q242. The inorder and preorder traversal of a binary tree are a b c a f c e g and a b d e c f g, Respectively. The
postorder traversal of the binary tree is :
a) d e b f g c a b) e d b g f c a c) e d b f c a d) d e f b c a
Q245. Assume the objects of type short, float and long occupy 2 byte, 4 byte and 8 byte respectively. The
memory requirement for variable t ignoring alignment considerations is
a) 14 byte b) 22 byte c) 18byte d) 10byte
Q248. The way a card game player arranges his cards as he picks them up one by one, is an example of
a) insertion sort b) merge sort c) selection sort d) bubble sort
24
USM’s Shriram Mantri Vidyanidhi Info Tech Academy
PG DAC Aug 19 Data Structure Question Bank
Q249. Which one is the simplest data structure:
a) Strut b) Tree c) Linked List d) Array
25
USM’s Shriram Mantri Vidyanidhi Info Tech Academy
PG DAC Aug 19 Data Structure Question Bank
Q.259) Any node is the path from the root to the node is called
a) Ancestor node c) Successor node c) Internal node d) None of the above
Q.261) A graph is a collection of nodes, called ...... And line segments called arcs or ...... that connect pair of
nodes.
a) vertices, paths b) vertices, edges c) graph node, edges d) edges, vertices
Q.262) In ........, search start at the beginning of the list and check every element in the list.
a) Binary search b) Hash Search c) Linear search d) Binary Tree search
Q. 263) In the ....... traversal we process all of a vertex’s descendants before we move to an adjacent vertex.
a) Depth Limited b) With First c) Breadth First d) Depth First
Q.264) A doubly linked list has .......... pointers with each node.
a) 0 b) 1 c) 2 d) 3
Q.265) A linear list in which each node has point to the predecessor and successors nodes is called ........
a) singly linked list b) linear linked list c) doubly linked list d) None of the above
Q.266) Indexing the........ element in the list is not possible in linked lists.
a) first b) middle c) last d) All of the above
Q. 267) To represent hierarchical relationship between elements, Which data structure is suitable?
a) Graph b) Tree c) Dequeue d) Priority
Q. 270) Which of the following data structure can’t store the nonhomogeneous data elements?
a) Arrays b) Stacks c) Records d) None of the above
Q.271) A binary search tree whose left subtree and right subtree differ in hight by at most 1 unit is called .....
a) Lemma tree b) Redblack tree c) AVL tree d) None of the above
Q.272) ...... is a pile in which items are added at one end and removed from the other.
a) List b) Queue c) Stack d) Array
26
USM’s Shriram Mantri Vidyanidhi Info Tech Academy
PG DAC Aug 19 Data Structure Question Bank
Q.273) Which of the following is non-linear data structure?
a) Trees b) Stacks c) Strings d) All of the above
Q. 278) Which of the following data structure store the homogeneous data elements?
a) Lists b) Pointers c) Records d) Arrays
Q.280) A ......... does not keep track of address of every element in the list.
a) Stack b) Queue c) String d) Linear array
Q.285) The space factor when determining the efficiency of algorithm is measured by
a) Counting the maximum memory needed by the algorithm
b) Counting the minimum memory needed by the algorithm
c) Counting the average memory needed by the algorithm
d) Counting the maximum disk space needed by the algorithm
27
USM’s Shriram Mantri Vidyanidhi Info Tech Academy
PG DAC Aug 19 Data Structure Question Bank
Q.286) The operation of processing each element in the list is known as
a) Traversal b) Inserting c) Merging d) Sorting
Q.290) Every node N in a binary tree T except the root has a unique parent called the ......... of N.
a) Predecessor b) Antecedents c) Precursor d) None of the above
Q.291) The in order traversal of tree will yield a sorted listing of elements of tree in....
a) Merging b) AVL Trees c) Binary trees d) Binary search trees
Q.292) A binary tree whose every node has either zero or two children is called.........
a) Extended binary tree b) Complete binary tree
c) Binary Search tree d) Disjoint tree
Q.293) The post order traversal of a binary tree is DEBFCA. Find out the pre order traversal
a) ABFCDE b) ADBFEC c) ABDECF d) ABDCEF
Q.294) Three standards ways of traversing a binary tree T with root R .......
a) Prefix, infix, postfix b) Pre-process, in-process, post-process
c) Pre-traversal, in-traversal, post-traversal d) Pre-order, in-order, post-order
Q.296) If a node having two children is deleted from a binary tree, it is replaced by its
a) Preorder predecessor b) Inorder predecessor
c) Inorder successor d) Preorder successor
28
USM’s Shriram Mantri Vidyanidhi Info Tech Academy
PG DAC Aug 19 Data Structure Question Bank
a) extraction b) range c) lower bound d) upper bound
Q.300) The data structure required for Breadth First Traversal on a graph is
a) queue b) stack c) array d) None of the above
Q.301) One can convert a binary tree into its mirror image by traversing it in
a) inorder b) preorder c) postorder d) None of the above
Q.303) Which of the following sorting methods would be most suitable for sorting a list which is almost sorted
a) Insertion Sort b) Selection Sort c) Quick Sort d) Bubble Sort
Q.304) The process of accessing data stored in a serial access memory is similar to manipulating data on a
a) heap b) queue c) stack d) None of the above
Q.306) A linear collection of data elements where the linear node is given by means of pointer is called
a) linked list b) node list c) primitive list d) None of these
Q.309) The complexity of multiplying two matrices of order m*n and n*p is
a) np b) mn+p c) mn d) mnp
Q.310) For an undirected graph with n vertices and e edges, the sum of the degree of each vertex is equal to
a) 2n b) 2e c) (e2+1)/2 d) (2n-1)/2
Q.311) Which data structure allows deleting data elements from and inserting at rear?
a) Stacks b) Queues c) Dequeues d) Binary search tree
Q.312) Which data structure is used in breadth first search of a graph to hold nodes?
a) Array b) Tree c) Stack d) queue
Q.313) Identify the data structure which allows deletions at both ends of the list but insertion at only one end.
a) Stack
29
USM’s Shriram Mantri Vidyanidhi Info Tech Academy
PG DAC Aug 19 Data Structure Question Bank
b) Priority queues
c) Output restricted qequeue
d) Input restricted dequeue
Q.315 In a queue, the initial values of front pointer f rare pointer r should be …….. and ……….. respectively.
a) 0 and 1 b) 0 and -1 c) -1 and 0 d) 1 and 0
Q.316) There is an extra element at the head of the list called a .........
a) Sentinel b) Antinel c) List head d) List header
Q.318) When new data are to be inserted into a data structure, but there is not available space; this situation
is usually called .......
a) overflow b) Underflow c) housefull d) memoryfull
Q.319) A data structure where elements can be added or removed at either end but not in the middle is called
a) stacks b) queues c) dequeuer d) linked lists
Q.320) The use of pointers to refer elements of a data structure in which elements are logically adjacent is ......
a) stack b) queue c) pointers d) linked allocation
Q.323) Which of the following conditions checks available free space in avail list?
a) Avail=Top b) Null=Avail c) Avail=Null d) Avail=Max stack
Q.325) ........ is a directed tree in which outdegree of each node is less than or equal to two.
a) Binary tree b) Dinary tree c) Unary tree d) None of the above
30
USM’s Shriram Mantri Vidyanidhi Info Tech Academy
PG DAC Aug 19 Data Structure Question Bank
a) (N/2)-1 b) (N+1)/2 c) (N-1)/2 d) (N+2)/2
Q.327) In ......, search start at the beginning of the list and check every element in the list.
a) Hash Search b) Binary search c) Linear search d) Binary Tree search
31
USM’s Shriram Mantri Vidyanidhi Info Tech Academy
PG DAC Feb 19 Data Structure Question Bank
Q.328 The operation that combines the element is of A and B in a single sorted list C with n=r+s element is
called.......
a) Sharing b) Merging c) Inserting d) None of the above
Q.342) .......... is the term used to delete an element from the stack?
a) Push b) Pull c) Pop d) All of the above
Q.343) Before inserting into stack one must check the condition.........
a) Overflow b) Underflow c) Maximum elements d) Existing elements
Q.346) The operation of processing each element in the list is known as......
a) merging b) traversal c) inserting d) sorting
32
USM’s Shriram Mantri Vidyanidhi Info Tech Academy
PG DAC Feb 19 Data Structure Question Bank
Q.350) The line drawn from a node N of tree T to a successor is called .......
a) Route b) Arrow c) Edge d) Path
Q.351 Which of the following sorting algorithms does not have a worst case running time of O(n2)?
a) Insertion sort b) Quick sort c) Bubble sort d) Merge sort
Q.354) The data structure required to check whether an expression contains balanced parenthesis is
a) Stack b) Queue c) Tree d) Array
Q.355) What data structure would you mostly likely see in a nonrecursive implementation of a recursive
algorithm?
a) Trees b) Linked list c) Stack d) Queue
Q.357) The pre-order and post order traversal of a Binary Tree generates the same output. The tree can
have
maximum
a) One node b) Two nodes c) Three nodes d) Any number of nodes
Q.362) A linear list in which the last node points to the first node is ........
a) singly linked list b) doubly linked list c) circular linked list d) none of the above
Q.363) A linear list in which the pointer points only to the successive node is......
a) singly linked list b) circular linked list c) doubly linked list d) none of the above
34