MCQOPTIONS
Saved Bookmarks
This section includes 58 Mcqs, each offering curated multiple-choice questions to sharpen your Data Structures Mcqs knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
A function in which f(n) is (g(n)), if there exist positive values k and c such that f(n)>=c*g(n), for all n>=k. This notation defines a lower bound for a function f(n): |
| A. | Big Omega (f) |
| B. | Big Theta (f) |
| C. | Big Oh O (f) |
| D. | None of the above |
| Answer» B. Big Theta (f) | |
| 2. |
A real world example of an algorithm would be a___________. |
| A. | Recipe |
| B. | Unit |
| C. | Food item |
| D. | None of the above |
| Answer» B. Unit | |
| 3. |
A text is made up of the characters a, b, c, d, e each occurring with the probability .12, .4, .15, .08 and .25 respectively. The optimal coding technique will have the average length of |
| A. | 1.78 |
| B. | 2.03 |
| C. | 2.15 |
| D. | 3.01 |
| Answer» D. 3.01 | |
| 4. |
Ackerman s function is defined on the non-negative integers as follows a (m,n) = n+1 if m=0 = a (m-1, 1) if m 0, n=0 = a (m-1, a(m, n-1)) if m 0, n 0 The value of a (1, 3) is |
| A. | 4 |
| B. | 5 |
| C. | 6 |
| D. | 7 |
| Answer» C. 6 | |
| 5. |
Algorithms are at the heart of every non-trivial computer application and also a modern and active area of ____________. |
| A. | Programming |
| B. | Computer processing |
| C. | Computer science |
| D. | None of the above |
| Answer» D. None of the above | |
| 6. |
An algorithm is |
| A. | A piece of code to be executed. |
| B. | A loosely written code to make final code. |
| C. | A step by step procedure to solve problem. |
| D. | All of the above. |
| Answer» D. All of the above. | |
| 7. |
An algorithm is made up of 2 modules M1&M2.; If order of M1 is f(n) & M2 is g(n) then the order of algorithm is? |
| A. | F(n) + g(n) |
| B. | F(n) X g(n) |
| C. | Max (f(n),g(n)) |
| D. | Min (f(n),g(n)) |
| Answer» E. | |
| 8. |
An algorithm is made up of 2 modules Ml and M2. If order of M1 is f(n) and M2 is g(n) then the order of the algorithm is |
| A. | F (n) + g (n) |
| B. | F (n) x g (n ) |
| C. | Min (f (n) ,g (n) ) |
| D. | Max (f (n) ,g (n)) |
| Answer» E. | |
| 9. |
An algorithm may have __________ inputs quantities. |
| A. | One or more |
| B. | Zero or more |
| C. | Two or more |
| D. | None of the above |
| Answer» C. Two or more | |
| 10. |
An algorithm performs lesser number of operations when the size of input is small, but performs more operations when the size of input gets larger. State if the statement is True or False or Maybe. |
| A. | True |
| B. | False |
| C. | Maybe |
| D. | None of the above |
| Answer» B. False | |
| 11. |
An algorithm that indicates the amount of temporary storage required for running the algorithm, i.e., the amount of memory needed by the algorithm to run to completion is termed as_____. |
| A. | Big Theta (f) |
| B. | Space complexity |
| C. | Big Oh O (f) |
| D. | None of the above |
| Answer» C. Big Oh O (f) | |
| 12. |
An algorithm that requires . operations to complete its task on n data elements is said to have a linear runtime. |
| A. | N^3 + 9 |
| B. | 3n^2 + 3n + 2 |
| C. | 2n + 1 |
| D. | 9 |
| Answer» D. 9 | |
| 13. |
An array of n numbers is given, where n is an even number. The maximum as well as the minimum of these n numbers needs to be determined. Which of the following is TRUE about the number of comparisons needed? |
| A. | At most 1.5n-2 comparisons are needed. |
| B. | At least nlog2n comparisons are needed. |
| C. | At least 2n-c comparisons, for some constant c, are needed. |
| D. | None of the above |
| Answer» B. At least nlog2n comparisons are needed. | |
| 14. |
Apriori analysis of an algorithm assumes that |
| A. | the algorithm has been tested before in real environment. |
| B. | All other factors like CPU speed are constant and have no effect on implementation. |
| C. | The algorithm needs not to be practical. |
| D. | None of the above. |
| Answer» C. The algorithm needs not to be practical. | |
| 15. |
Which of the following sorting algorithms does not have a worst case running time of O(n2)? |
| A. | Quick sort |
| B. | Bubble sort |
| C. | Merge sort |
| D. | Insertion sort |
| Answer» D. Insertion sort | |
| 16. |
Which of the following uses memoization? |
| A. | Greedy approach |
| B. | Divide and conquer approach |
| C. | Dynamic programming approach |
| D. | None of the above |
| Answer» D. None of the above | |
| 17. |
Which of the following uses memorization? |
| A. | Greedy approach |
| B. | Divide and conquer approach |
| C. | Dynamic programming approach |
| D. | None of the above |
| Answer» D. None of the above | |
| 18. |
Which of these algorithmic approach tries to achieve localized optimum solution |
| A. | Greedy approach |
| B. | Divide and conquer approach |
| C. | Dynamic approach |
| D. | All of the above |
| Answer» B. Divide and conquer approach | |
| 19. |
Who should know about the basic algorithmic toolbox structures that allow efficient organization and retrieval of data frequently used algorithms and basic techniques for modeling, understanding and solving algorithmic problems? |
| A. | Computer scientist |
| B. | Professional programmers |
| C. | Both (a) and (b) |
| D. | None of the above |
| Answer» D. None of the above | |
| 20. |
___________ refers to a finite set of steps, which, when followed, solves a particular problem. |
| A. | Algorithm |
| B. | Finiteness |
| C. | Output |
| D. | None of the above |
| Answer» B. Finiteness | |
| 21. |
___________algorithm is one which utilizes minimum processor time and requires minimum memory space during its execution. |
| A. | Best |
| B. | Efficient |
| C. | Both (a) and (b) |
| D. | None of the above |
| Answer» D. None of the above | |
| 22. |
Operations performed on scalar quantities are termed simple, while operations on vector data normally termed as_______. |
| A. | Complex |
| B. | Not very complex |
| C. | Simple |
| D. | None of the above |
| Answer» B. Not very complex | |
| 23. |
Program with highest run-time complexity is |
| A. | Tower of Hanoi |
| B. | Fibonacci Series |
| C. | Prime Number Series |
| D. | None of the above |
| Answer» B. Fibonacci Series | |
| 24. |
Project scheduling is an example of |
| A. | Greedy programming |
| B. | Dynamic programming |
| C. | Divide and conquer |
| D. | None of the above. |
| Answer» C. Divide and conquer | |
| 25. |
Six files Fl, F2, F3, F4, F5 and F6 have 100,200,50,80, 120, 150 number of records respectively. In what order should they be stored so as to optimize access time? Assume each file is accessed with the same frequency. |
| A. | Fl, F2, F3, F4, F5, F6 |
| B. | F2, F6, F5, Fl, F4, F3 |
| C. | F3, F4, FI, F5, F6, F2 |
| D. | Ordering is immaterial as all files are accessed with the same frequency |
| Answer» D. Ordering is immaterial as all files are accessed with the same frequency | |
| 26. |
Space complexity of an algorithm is the maximum amount of _______ required by it during execution. |
| A. | Time |
| B. | Operations |
| C. | Memory space |
| D. | None of the above |
| Answer» D. None of the above | |
| 27. |
The amount of time the computer needs to run to completion is known as_____. |
| A. | Space complexity |
| B. | Time complexity |
| C. | Recursive function |
| D. | None of the above |
| Answer» C. Recursive function | |
| 28. |
The complexity of adding two matrices of order m*n is |
| A. | M + n |
| B. | Mn |
| C. | Max(m, n) |
| D. | Min(m, n) |
| Answer» C. Max(m, n) | |
| 29. |
The running time of an algorithm is given by T(n) = T(n 1) + T(n 2) T(n 3), if n > 3 n, otherwise. |
| A. | N |
| B. | Log n |
| C. | N+1 |
| D. | None of these |
| Answer» B. Log n | |
| 30. |
The concept of order (Big O) is important because |
| A. | It can be used to decide the best algorithm that solves a given problem |
| B. | It determines the maximum size of a problem that can be solved in a given system, in a given amount of time |
| C. | All of the above |
| D. | None of these |
| Answer» D. None of these | |
| 31. |
Apriory algorithm analysis does not include |
| A. | Time Complexity |
| B. | Space Complexity |
| C. | Program Complexity |
| D. | None of the above |
| Answer» D. None of the above | |
| 32. |
Each operation must have a definite meaning and it must be perfectly clear. All steps of an algorithm need to be precisely defined. The actions to be executed in each case should be _____________. |
| A. | Rigorously specified |
| B. | Clearly specified |
| C. | Both (a) and (b) |
| D. | None of the above |
| Answer» D. None of the above | |
| 33. |
For many problems such as sorting, there are many choices of algorithms to use, some of which are extremely___________. |
| A. | Space efficient |
| B. | Time efficient |
| C. | Both (a) and (b) |
| D. | None of the above |
| Answer» D. None of the above | |
| 34. |
Frequently, the memory space required by an algorithm is a multiple of the size of input. State if the statement is True or False or Maybe. |
| A. | True |
| B. | False |
| C. | Maybe |
| D. | None of the above |
| Answer» B. False | |
| 35. |
If the array is already sorted, which of these algorithms will exhibit the best performance |
| A. | Merge Sort |
| B. | Insertion Sort |
| C. | Quick Sort |
| D. | Heap Sort |
| Answer» C. Quick Sort | |
| 36. |
In general, a problem may be defined as a state of thing that is not in the___________. |
| A. | Wrong order |
| B. | Opposite order |
| C. | Right order |
| D. | None of the above |
| Answer» D. None of the above | |
| 37. |
In context with time-complexity, find the odd out |
| A. | Deletion from Linked List. |
| B. | Searching in Hash Table |
| C. | Adding edge in Adjacency Matrix |
| D. | Heapify a Binary Heap |
| Answer» E. | |
| 38. |
In simple terms, we can say that an algorithm is a step-by-step procedure for performing some task in a finite amount of time. State if the statement is true or false. |
| A. | False |
| B. | True |
| C. | Maybe |
| D. | None of the above |
| Answer» C. Maybe | |
| 39. |
In the analysis of algorithms, what plays an important role? |
| A. | Text Analysis |
| B. | Growth factor |
| C. | Time |
| D. | None of the above |
| Answer» C. Time | |
| 40. |
Interpolation search is an improved variant of binary search. It is necessary for this search algorithm to work that |
| A. | Data collection should be in sorted form and equally distributed. |
| B. | Data collection should be in sorted form and but not equally distributed. |
| C. | Data collection should be equally distributed but not sorted. |
| D. | None of the above. |
| Answer» B. Data collection should be in sorted form and but not equally distributed. | |
| 41. |
Let A be an array of 31 numbers consisting of a sequence of 0 s followed by a sequence of 1 s. The problem is to find the smallest index i such that A[i] is 1 by probing the minimum number of locations in A. The worst case number of probes performed by an optimal algorithm is________. |
| A. | 2 |
| B. | 3 |
| C. | 4 |
| D. | 5 |
| Answer» E. | |
| 42. |
Let m, n be positive integers. Define Q (m, n) as Q (m, n) = 0, if m>n Then Q (m, 3) is (a div b, gives the quotient when a is divided by b) |
| A. | 3 x p |
| B. | A constant |
| C. | P x (m div 3) |
| D. | P x (m mod 3) |
| Answer» D. P x (m mod 3) | |
| 43. |
lg (n!) = .. |
| A. | O(n) |
| B. | O(lg n) |
| C. | O(n^2) |
| D. | O(n lg n) |
| Answer» E. | |
| 44. |
Merging 4 sorted files containing 50, 10, 25 and 15 records will take____time. |
| A. | O (100) |
| B. | O (200) |
| C. | O (175) |
| D. | O (125) |
| Answer» B. O (200) | |
| 45. |
Minimum number of moves required to solve a Tower of Hanoi puzzle is |
| A. | 2n2 |
| B. | 2n-1 |
| C. | 2n - 1 |
| D. | 2n - 1 |
| Answer» E. | |
| 46. |
The space factor when determining the efficiency 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» B. Counting the minimum memory needed by the algorithm | |
| 47. |
The time complexity of an algorithm T(n), where n is the input size, is given by T( n) = T( n 1) + 1/n if n > 1 The order of this algorithm is |
| A. | N |
| B. | Log n |
| C. | N+1 |
| D. | N-1 |
| Answer» C. N+1 | |
| 48. |
The two main resources that we consider for an algorithm are__________. |
| A. | Memory space and processor time |
| B. | Space complexity and time complexity |
| C. | Input and output properties |
| D. | None of the above |
| Answer» B. Space complexity and time complexity | |
| 49. |
The time complexity of quick sort is .. |
| A. | O(n) |
| B. | O(n2) |
| C. | O(n log n) |
| D. | O(log n) |
| Answer» D. O(log n) | |
| 50. |
To verify whether a function grows faster or slower than the other function, we have some asymptotic or mathematical notations, which is_________. |
| A. | Big Omega (f) |
| B. | Big Theta (f) |
| C. | Big Oh O (f) |
| D. | All of the above |
| Answer» E. | |