MCQOPTIONS
Saved Bookmarks
This section includes 7 Mcqs, each offering curated multiple-choice questions to sharpen your Data Structures and Algorithms knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
1 2, 1 2, 2 ? |
| A. | 1 2, 1 2, 2 2 , |
| B. | 1 2, 2 1, 2 2 , |
| C. | 1 2, 2 1, 2 2 |
| Answer» C. 1 2, 2 1, 2 2 | |
| 2. |
What will be the time complexity of the code to print combinations? |
| A. | O(n) |
| B. | O(n<sup>2</sup>) |
| C. | O(n log n) |
| D. | O(2<sup>n</sup>) |
| Answer» E. | |
| 3. |
The code for printing combinations is in-place. |
| A. | true |
| B. | false |
| Answer» C. | |
| 4. |
What will be the auxiliary space requirement (excluding call stack) of the program to print combinations of r elements each from array of size n? |
| A. | O(n*r) |
| B. | O(n/r) |
| C. | O(n) |
| D. | O(r) |
| Answer» E. | |
| 5. |
What will be the lexicographical order of combinations of 2 elements each formed from the array arr={1,2,3}? |
| A. | {{2,1},{3,2},{3,1}} |
| B. | {{1,2},{2,3},{1,3}} |
| C. | {{1,2},{1,3},{2,3}} |
| D. | {{2,1},{3,1},{3,2}} |
| Answer» D. {{2,1},{3,1},{3,2}} | |
| 6. |
How many combinations of 2 elements will be formed from the array arr={1,2,3}? |
| A. | 1 |
| B. | 2 |
| C. | 3 |
| D. | 4 |
| Answer» D. 4 | |
| 7. |
What is meant by the term lexicographical order? |
| A. | dictionary ordering of elements |
| B. | reverse dictionary ordering of elements |
| C. | to sort according to value of first element |
| D. | to sort according to value of last element |
| Answer» B. reverse dictionary ordering of elements | |