MCQOPTIONS
Saved Bookmarks
This section includes 17 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. |
Which of the following arrays are used in the implementation of list data type in python? |
| A. | Bit array |
| B. | Dynamic arrays |
| C. | Sparse arrays |
| D. | Parallel arrays |
| Answer» C. Sparse arrays | |
| 2. |
In special case, the time complexity of inserting/deleting elements at the end of dynamic array is __________ |
| A. | O (n) |
| B. | O (n1/2) |
| C. | O (log n) |
| D. | O (1) |
| Answer» B. O (n1/2) | |
| 3. |
The growth factor of ArrayList in Java is _______ |
| A. | 1 |
| B. | 1.5 |
| C. | 2 |
| D. | 0 |
| Answer» C. 2 | |
| 4. |
In which of the following cases dynamic arrays are not preferred? |
| A. | If the size of the array is unknown |
| B. | If the size of the array changes after few iterations |
| C. | If the memory reallocation takes more time i.e. expensive |
| D. | If the array holds less number of elements |
| Answer» E. | |
| 5. |
Both Dynamic array and Dynamically memory allocated array are same. |
| A. | True |
| B. | False |
| Answer» C. | |
| 6. |
The size of the dynamic array is deallocated if the array size is less than _________% of the backend physical size. |
| A. | 30 |
| B. | 40 |
| C. | 10 |
| D. | 20 |
| Answer» B. 40 | |
| 7. |
Dynamic arrays overcome the limit of static arrays. |
| A. | True |
| B. | False |
| Answer» B. False | |
| 8. |
Which of the following is a disadvantage of dynamic arrays? |
| A. | Locality of reference |
| B. | Data cache utilization |
| C. | Random access |
| D. | Memory leak |
| Answer» E. | |
| 9. |
Array is divided into two parts in ____________ |
| A. | Hashed Array Tree |
| B. | Geometric Array |
| C. | Bounded-size dynamic array |
| D. | Sparse Array |
| Answer» D. Sparse Array | |
| 10. |
What is the time complexity for inserting/deleting at the beginning of the array? |
| A. | O(1) |
| B. | O(n) |
| C. | O(logn) |
| D. | O(nlogn) |
| Answer» C. O(logn) | |
| 11. |
What are the advantages of dynamic arrays? |
| A. | Locality of reference |
| B. | Data cache utilization |
| C. | Random access |
| D. | All of the mentioned |
| Answer» E. | |
| 12. |
In what type of dynamic array do you divide the array into two parts? |
| A. | Hashed Array Tree |
| B. | Geometric Array |
| C. | Bounded-size dynamic array |
| D. | None of the mentioned |
| Answer» D. None of the mentioned | |
| 13. |
Which of the following is the correct syntax to declare an ArrayList in Java? |
| A. | ArrayList al = new ArrayList(); |
| B. | ArrayList al = new ArrayList[]; |
| C. | ArrayList al() = new ArrayList(); |
| D. | ArrayList al[] = new ArrayList[]; |
| Answer» B. ArrayList al = new ArrayList[]; | |
| 14. |
How will you implement dynamic arrays in Java? |
| A. | Set |
| B. | Map |
| C. | HashMap |
| D. | List |
| Answer» E. | |
| 15. |
The number of items used by the dynamic array contents is its __________ |
| A. | Physical size |
| B. | Capacity |
| C. | Logical size |
| D. | Random size |
| Answer» D. Random size | |
| 16. |
What is meant by physical size in a dynamic array? |
| A. | The size allocated to elements |
| B. | The size extended to add new elements |
| C. | The size of the underlying array at the back-end |
| D. | The size visible to users |
| Answer» D. The size visible to users | |
| 17. |
What is a dynamic array? |
| A. | A variable size data structure |
| B. | An array which is created at runtime |
| C. | The memory to the array is allocated at runtime |
| D. | An array which is reallocated everytime whenever new elements have to be added |
| Answer» B. An array which is created at runtime | |