Which data structure stores its elements in contiguous memory locations?
- A Array
- B Linked list
- C Stack
- D Tree
Explanation
An array stores elements in consecutive memory locations, which is why any element can be reached directly by its index.
Which data structure stores its elements in contiguous memory locations?
An array stores elements in consecutive memory locations, which is why any element can be reached directly by its index.