Data Structure Questions for ARICENT
Q. No. : 1
Question : The Average case occur in linear search algorithm
A : When Item is somewhere in the middle of the array
B : When Item is not in the array at all
C : When Item is the last element in the array
D : When Item is the last element in the array or is not there at all
Answer: A
Q. No. : 2
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. : 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 : Which of the following data structure store the homogeneous data elements?
A : Arrays
B : Records
C : Pointers
D : Pointers
Answer: B
Q. No. : 5
Question : Stack is useful for implementing
A : radix sort
B : breadth first search
C : recursion
D : depth first search
Answer: D
Q. No. : 6
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. : 7
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. : 8
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. : 9
Question : Linked lists are best suited
A : for relatively permanent collections of data
B : for the size of the structure and the data in the structure are constantly changing
C : for both of above situation
D : for none of above situation
Answer: B
Q. No. : 10
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. : 11
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 Remember its Big O notation
Q. No. : 12
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. : 13
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. : 14
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. : 15
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 Make a syntax tree and do a inorder traversal
Q. No. : 16
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. : 17
Question : The complexity of linear search algorithm is
A : O(n)
B : O(log n)
C : O(n2 )
D : O(n log n)
Answer: A
Q. No. : 18
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. : 19
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. : 20
Question : In a balance binary tree the height of two sub trees of every node can not differ by more than
A : 2
B : 1
C : 0
D : 3
Answer: B
Q. No. : 21
Question : Arrays are best data structures
A : for relatively permanent collections of data
B : for the size of the structure and the data in the structure are constantly changing
C : for both of above situation
D : or none of above situation
Answer: A
Q. No. : 22
Question : 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
Answer: A
Q. No. : 23
Question : Which of the following data structure is linear data structure?
A : Trees
B : Graphs
C : Arrays
D : None of above
Answer: C
Q. No. : 24
Question : Which of the following operations is performed more efficiently by doubly linked list than by linear linked list ?
A : Deleting a node whose location is given
B : Searching an unsorted list for a given item
C : Inserting a node after the node with a given location
D : Traversing the list to process each node
Answer: A
Q. No. : 25
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. : 26
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. : 27
Question : What is the worst case time complexity of Bubble sort
A : O(1)
B : O(logn)
C : O(n)
D : O(n2 )
Answer: D
Q. No. : 28
Question : Which of the following is useful in implementing quick sort
A : Stack
B : Set
C : List
D : Queue
Answer: A
Q. No. : 29
Question : In linked lists there are no NULL links in:
A : SinÂgle linked list
B : LinÂear douÂbly linked list
C : cirÂcuÂlar linked list
D : None of the above
Answer: C
Q. No. : 30
Question : The order of magnitude of the worst case performance of ordered binary tree with N elements is
A : N logN
B : N
C : N2
D : logN
Answer: B