Welcome Guest

Data Structure Questions for ARICENT

Q. No. :1
Question :Preorder is nothing but
A :
Depth first order
B :
Breadth first order
C :
Topological order
D :
Linear order
Answer: A
Q. No. :2
Question :The depth of complete binary tree with n nodes is
A :
log(n+1)-1
B :
log(n)
C :
log(n-1)+1
D :
log(n)+1
Answer: A
Solution
Q. No. :3
Question :Which of the following sorting method is stable?
A :
Straight insertion sort
B :
Binary insertion sort
C :
Shell sort
D :
Heap sort
Answer: A
Q. No. :4
Question :Stack is useful for implementing
A :
radix sort
B :
breadth first search
C :
recursion
D :
depth first search
Answer: D
Q. No. :5
Question :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 :
Selection Sort
B :
Insertion Sort
C :
Heap Sort
D :
Quick Sort
Answer: B
Q. No. :6
Question :The infix expression A+(B-C)*D is correctly represented in prefix notation as
A :
A+B-C*D
B :
+A*-BCD
C :
ABC-D*+
D :
A+BC-D*
Answer: B
Solution
Q. No. :7
Question : The total number of comparisons in a bubble sort is
A :
O(n log n)
B :
O(2n)
C :
O(n2)
D :
None of the above
Answer: C
Q. No. :8
Question :In what tree, for every node the height of its left subtree and the right subtree differ atmost by one
A :
Binary Search Tree
B :
AVL Tree
C :
Complete Tree
D :
Threaded Binary Tree
Answer: B
Q. No. :9
Question :Which of the following procedure is slowest?
A :
Quick tree
B :
Heap sort
C :
Shell sort
D :
Bubble sort
Answer: D
Q. No. :10
Question :In a bal­ance binary tree the height of two sub trees of every node can not dif­fer by more than
A :
2
B :
1
C :
0
D :
3
Answer: B
Q. No. :11
Question :Stack cant be used to
A :
Evaluate an arithmetic expression in postfix form
B :
Implement recursion
C :
Convert a given arithmetic expression in infix form to its equivalent post fix form
D :
Allocate resources by the operating system
Answer: D
Solution
Q. No. :12
Question :For a linear search in an array of n elements, the time complexity for best, worst and average cases are
A :
O(n), O(1),O(n/2)
B :
O(1), O(n),O(n/2)
C :
O(1), O(n),O(n)
D :
O(1), O(n),O((n-1)/2)
Answer: C
Solution
Q. No. :13
Question :A full binary Tree with N leaves will contain
A :
N nodes
B :
logN nodes
C :
2n-1 nodes
D :
2n nodes
Answer: C
Q. No. :14
Question :A _______ is a data structure that organizes data similar to a line in the supermarket, where the first one in line is the first one out.
A :
queue linked list
B :
stacks linked list
C :
both of them
D :
neither of them
Answer: A
Q. No. :15
Question :Which of the following list of nodes corresponds to a post order traversal of the binary tree shown :
A :
A B C D E F G H I J
B :
A B C D E H C F I J
C :
D H E B I F J G C A
D :
D B E H A I F C J G
Answer: C
Q. No. :16
Question :The Worst case occur in linear search algorithm when
A :
Item is somewhere in the middle of the array
B :
Item is not in the array at all
C :
Item is the last element in the array
D :
Item is the last element in the array or is not there at all
Answer: D
Q. No. :17
Question :Give the correct matching for the following pair
(A) O(log n) (P) Selection
(B) O(n) (Q) Insertion sort
(C) O(n log n) (R) Binary Search
(D) O(n2) (S) Merge sort
A :
A-R, B-P, C-Q, D-S
B :
A-R, B-P, C-S, D-Q
C :
A-P, B-R, C-S, D-Q
D :
A-P, B-S, C-R, D-Q
Answer: B
Q. No. :18
Question :Which of the following statement is false?
A :
Arrays are dense lists and static data structure
B :
data elements in linked list need not be stored in adjecent space in memory
C :
pointers store the next data element of a list
D :
linked lists are collection of the nodes that contain information part and next pointer
Answer: C
Q. No. :19
Question : The postfix expression for the infix expression A+B*(C+D)/F+D*E is
A :
AB+CD+*F/D+E*
B :
ABCD+*F/+DE*+
C :
A*B+CD/F*DE++
D :
A+*BCD/F*DE++
Answer: B
Q. No. :20
Question :The five item A,B,C,D and E are pushed in a stack, one after another starting from A. The stack is popped four times and each element is inserted in a queue. The two elements are deleted from the queue and pushed back on stack. Now one item is popped from stack. The popped item is:
A :
A
B :
B
C :
C
D :
D
Answer: D
Solution
Q. No. :21
Question :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
Answer: B
Q. No. :22
Question :What is the worst time complexity of straight insertion sort algorithm to sort n elements?
A :
O(n)
B :
O(nlogn)
C :
O(n1.5)
D :
O(n2)
Answer: D
Q. No. :23
Question :3. Which of the following data structures are indexed structures?
A :
linear arrays
B :
linked lists
C :
both of above
D :
none of above
Answer: A
Q. No. :24
Question :The initial configuration of queue is a, b, c, d ('a' is at the front). To get the configuration d, c, b, a, one needs a minimum of
A :
2 deletions and 3 additions
B :
3 deletions and 2 additions
C :
3 deletions and 3 additions
D :
3 deletions and 4 additions
Answer: C
Q. No. :25
Question :Which of the following data structure store the homogeneous data elements?
A :
Arrays
B :
Records
C :
Pointers
D :
Pointers
Answer: B
Q. No. :26
Question :In an array representation of binary tree the right child of root will be at location of
A :
2
B :
5
C :
3
D :
0
Answer: C
Q. No. :27
Question :The result of evaluating prefix expression */b+-dacd, where a = 3, b = 6, c = 1, d = 5 is
A :
0
B :
5
C :
10
D :
15
Answer: C
Solution
Q. No. :28
Question :Why is the constructor of the QueueLinkedList class empty?
A :
because initialization of data members of the LinkedList class is performed by the constructor of the LinkedList class.
B :
because initialization of data members of the LinkedList class is performed by the destructor of the LinkedList class.
C :
because initialization of data members of the QueueLinkedList class is performed by the constructor of the LinkedList class.
D :
because initialization of data members of the QueueLinkedList class is performed by the destructor of the LinkedList class
Answer: A
Q. No. :29
Question :A fully binary tree with n non-leaf nodes contains
A :
logn nodes
B :
n+1 nodes
C :
2n nodes
D :
2n+1 nodes
Answer: D
Q. No. :30
Question :Which of the following data structure is linear data structure?
A :
Trees
B :
Graphs
C :
Arrays
D :
None of above
Answer: C