Data-Structure-And-Algorithms (Set 4)
Data-Structure-And-Algorithms (Set 4)
4 of 4 sets
302. The following data structure allows deleting data elements from front and
inserting at rear
A. Stacks
o m
B. Queues
. c
C. Deques
te
D. Binary search tree
a
Answer:B
q M
c
M
303. This data structure 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 the above
Answer:A
306. To represent hierarchical relationship be- tween elements, the following data
structure is not suitable
A. Deque
B. Priority
C. Tree
D. All of above
Answer:C
307. 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
Answer:C
312. When representing any algebraic expression E the following 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 exter- nal nodes and variables in internal nodes
C. the variables and operations in E will appear only in internal nodes
D. None of the above
Answer:A
313. 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 the above
Answer:A
314. The post order traversal of a binary tree is DEBFCA. Find out the pre order
traversal
A. ABFCDE
B. ADBFEC
C. ABDECF
D. None of the above
315. Which of the following data structure is lin- ear data structure?
A. Trees
B. Graphs
C. Arrays
D. None of the above
Answer:C
317. Finding the location of the element with a given value is called
A. Traversal
B. Search
C. Sort
D. All of the above
Answer:B
320. Each array declaration need not give, implicitly or explicitly, the information
about the
A. name of array
B. data type of array
C. first data from the set to be stored
D. index set of the array
Answer:C
322. The indirect change of the values of a vari- able in one module by another
module is called
A. internal change
B. inter-module change
C. side effect
D. all the above
Answer:C
324. The time factor when determining the effi- ciency of algorithm is measured by
A. Counting the number of key operations
B. Counting the number of statements
C. Counting the kilobytes of algorithm
325. The space factor when determining the effi- ciency 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
Answer:A
326. All the above* 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
327. Which of the following is not the required condition for binary search
algorithm
A. there must be mechanism to delete and/ or insert elements in list
B. the list must be sorted
C. there should be the direct access to the middle element in any sublist
D. none of the above
Answer:A
331. A data structure where elements can be added or removed at either end but
not in the middle is referred as
A. Linked lists
B. Stacks
C. Queues
D. Deque
Answer:D
Explanation:- Quick sort is a divide-and-conquer sorting algorithm that works by partitioning a list of
items into two smaller lists and then sorting each of these lists recursively. It is an efficient and
widely used algorithm, with an average case time complexity of O(n log n).
Bubble sort and insertion sort are both comparison-based sorting algorithms, but they do not use the
divide-and-conquer approach. Bubble sort works by repeatedly swapping adjacent elements that are
out of order, while insertion sort works by iteratively inserting each element into its correct position in
the sorted list. Both of these algorithms have a time complexity of O(n^2) in the worst case.
334. The elements of an array are stored suc- cessively 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. A and B both false
D. A and B both true
Answer:A
336. The memory address of fifth element of an array can be calculated by the
formula
A. LOC(Array[5])=Base(Array[5])+(5-lower boun(D), where w is the number of words per memory
cell for the array
B. LOC(Array[5])=Base(Array[4])+(5-Upper boun(D), where w is the number of words per memory
cell for the array
C. LOC(Array[5]=Base(Array)+w(5-lower bou
D. , where w is the number of words per memory cell for the array
Answer:C
337. The following data structure can’t store the non-homogeneous data elements
A. Arrays
B. Records
C. Pointers
338. 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
Answer:B
343. The following data structure store the ho- mogeneous data elements
A. Arrays
B. Records
C. Pointers
D. None of the above
Answer:B
344. Which of the following data structure is not linear data structure?
A. Arrays
B. Linked lists
C. A and B are true
D. None is true
Answer:C