Quiznetik
Data Structure and Algorithms (DSA) | Set 4
1. The complexity of the average case of an algorithm is
A. Much more complicated to analyze than that of worst case
B. Much more simpler to analyze than that of worst case
C. Sometimes more complicated and some other times simpler than that of worst case
D. None of the above
Correct : A. Much more complicated to analyze than that of worst case
2. The following data structure allows deleting data elements from front and inserting at rear
A. Stacks
B. Queues
C. Deques
D. Binary search tree
Correct : B. Queues
3. 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
Correct : A. Input-restricted deque
4. The following data structure is non-linear type
A. Strings
B. Lists
C. Stacks
D. None of the above
Correct : D. None of the above
5. The following data structure is linear type
A. Strings
B. Lists
C. Queues
D. All of the above
Correct : D. All of the above
6. To represent hierarchical relationship be- tween elements, the following data structure is not suitable
A. Deque
B. Priority
C. Tree
D. All of above
Correct : C. Tree
7. 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
Correct : C. Extended binary tree
8. 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
Correct : D. Dn = log2n+1
9. The complexity of Binary search algorithm is
A. O(n)
B. O(log )
C. O(n log n)
D. None of the above
Correct : B. O(log )
10. The complexity of Bubble sort algorithm is
A. O(n)
B. O (n2)
C. O(n log n)
D. None of the above
Correct : B. O (n2)
11. When in order 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
Correct : B. FAEKCDHGB
12. 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
Correct : A. the variable in E will appear as external nodes and operations in internal nodes
13. 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
Correct : A. internal nodes on extended tree
14. 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
Correct : C. ABDECF
15. Which of the following data structure is lin- ear data structure?
A. Trees
B. Graphs
C. Arrays
D. None of the above
Correct : C. Arrays
16. The operation of processing each element in the list is known as
A. Merging
B. Inserting
C. Traversal
D. All the above
Correct : C. Traversal
17. Finding the location of the element with a given value is called
A. Traversal
B. Search
C. Sort
D. All of the above
Correct : B. Search
18. Arrays are best data structures for
A. relatively permanent collections of data
B. the size of the structure and the data in the structure are constantly changing
C. both of above situation
D. none of above situation
Correct : A. relatively permanent collections of data
19. Linked lists are best suited for
A. relatively permanent collections of data
B. the size of the structure and the data in the structure are constantly changing
C. both of above situation
D. none of above situation
Correct : B. the size of the structure and the data in the structure are constantly changing
20. 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
Correct : C. first data from the set to be stored
21. The complexity of merge sort algorithm is
A. O(n)
B. O(log n)
C. O(n log n)
D. None of these
Correct : C. O(n log n)
22. 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
Correct : C. side effect
23. Two main measures for the efficiency of an algorithm are
A. Time and space
B. Processor and memory
C. Complexity and capacity
D. Data and space
Correct : A. Time and space
24. 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
D. None of the above
Correct : A. Counting the number of key operations
25. 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
Correct : A. Counting the maximum memory needed by the algorithm
26. 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
Correct : A. linear arrays
27. 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
Correct : A. there must be mechanism to delete and/ or insert elements in list
28. Which of the following is not a limitation of binary search algorithm ?
A. binary search algorithm is not efficient when the data elements are more than 1000.
B. must use a sorted array
C. requirement of sorted array is expen- sive when a lot of insertion and dele- tions are needed
D. there must be a mechanism to access middle element directly
Correct : A. binary search algorithm is not efficient when the data elements are more than 1000.
29. Two dimensional arrays are also called
A. tables arrays
B. matrix arrays
C. both of the above
D. none of the above
Correct : C. both of the above
30. The term “push” and “pop” is related to the
A. Array
B. Lists
C. stacks
D. all of above
Correct : C. stacks
31. 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
Correct : D. Deque
32. The following sorting algorithm is of divide- and-conquer type
A. Bubble sort
B. Insertion sort
C. Quick sort
D. None of the above
Correct : C. Quick sort
33. An algorithm that calls itself directly or indi- rectly is known as
A. Recursion
B. Polish notation
C. Traversal algorithm
D. None of the above
Correct : A. Recursion
34. 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
Correct : A. by this way computer can keep track only the address of the first element and the addresses of other elements can be calculated
35. The memory address of the first element of an array is called
A. base address
B. floor address
C. foundation address
D. first address
Correct : A. base address
36. 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
Correct : C. LOC(Array[5]=Base(Array)+w(5-lower bou
37. The following data structure can’t store the non-homogeneous data elements
A. Arrays
B. Records
C. Pointers
D. None of the above
Correct : A. Arrays
38. 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
Correct : B. Binary search trees
39. In a Heap tree values in a node is greater than
A. every value in left sub tree and smaller than right sub tree
B. every value in children of it
C. Both of above conditions are true
D. None of above conditions are true
Correct : B. every value in children of it
40. In a graph if e=[u, v], Then u and v are called
A. endpoints of e
B. adjacent nodes
C. neighbors
D. all of the above
Correct : D. all of the above
41. A connected graph T without any cycles is called
A. tree graph
B. free tree
C. tree
D. All of the above
Correct : D. All of the above
42. The difference between linear array and a record is
A. An array is suitable for homogeneous data but hte data items in a record may have different data type
B. In a record, there may not be a natural ordering in opposed to linear array.
C. A record form a hierarchical structure but a linear array does not
D. All of above
Correct : D. All of above
43. The following data structure store the ho- mogeneous data elements
A. Arrays
B. Records
C. Pointers
D. None of the above
Correct : B. Records
44. 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
Correct : C. A and B are true