Data Structure Interview Questions and Answers
Ques:- When is insertion sort a good choice for sorting an array?
A. The array has only a few elements out of place
B. Each element of array requires a small amount of memory
C. The processor speed is fast
D. Each element of array requires a large amount of memory
Ques:- A binary tree in which all its levels except the last, have maximum numbers of nodes, and all the nodes in the last level have only one child it will be its left child. Name the tree.
A. Threaded tree
B. Complete binary tree
C. M-way search tree
D. Full binary tree
Ques:- Which of following data structure is more appropriate for implementing quick sort iteratively?
A. Deque
B. Queue
C. Stack
D. Priority queue
Ques:- The number of edges in a complete graph of n vertices is
A. n(n+1)/2
B. n(n-1)/2
C. n2/2
D. n
Ques:- If two trees have same structure and but different node content, then they are called ___
A. Synonyms trees
B. Joint trees
C. Equivalent trees
D. Similar trees
Ques:- If two trees have same structure and node content, then they are called ____
A. Synonyms trees
B. Joint trees
C. Equivalent trees
D. Similar trees
Ques:- A graph is a tree if and only if graph is
A. Directed graph
B. Contains no cycles
C. Planar
D. Completely connected
Ques:- An enqueue operation adds an element
A. At any position in the queue
B. To the front of the queue
C. To the rear of the queue
D. None of above
Ques:- An index is a pair of elements comprising key and a file pointer or record number. A file in which indices are is known as ____
A. Index file
B. Sort file
C. Key file
D. None of above
Ques:- A data item that can be used to distinguish between two entities (records) is known as
A. Alternate key
B. Primary key
C. Primary data item
D. Unique data item
Ques:- What kind of list is best to answer many questions such as “what is the item at position n?”
A. Singly-linked lists
B. Doubly-linked lists
C. Lists implemented with an array
D. Circular- linked lists
Ques:- A data structure whose elements form a sequence is known as
A. Heterogeneous data structure
B. Homogeneous data structure
C. Linear data structures
D. Non- linear data structure
Ques:- Which of following operations are generally not performed on report files?
A. Updation
B. Maintenance
C. Retrieval
D. All of above
Ques:- Which of the following data structure is used to represent hierarchical relationship among its elements?
A. Queue
B. Hash table
C. Tree
D. Graph
Ques:- Which of the following statements about a binary tree is not correct?
A. Every binary tree has at least one node
B. Every non-empty tree has exactly one root node
C. Every node has at most two children
D. Every non-root node has exactly one parent
Ques:- The average case complexity of quick sort for sorting n numbers is
A. O(n2)
B. O(nlog2n)
C. O(n)
D. O(log2n)
Ques:- A dequeue operation removes an element
A. From the front of the queue
B. From any place in the queue
C. From the rear of the queue
D. None of above
Ques:- What is the minimum number of nodes in a complete binary tree with depth 3?
A. 4
B. 5
C. 6
D. 7