Array Quiz for DSA (original) (raw)
Which option correctly define the advantages of array?
- Arrays allow random access and cache friendliness due to contiguous memory allocation.
- Arrays allow efficient insertions and deletions in the middle.
- Arrays provide low memory usage by storing references instead of actual data.
- Arrays are slower than other data structures in accessing elements.
The first Index of the array typically starts from -----
Which method is used to access elements in an array?
**How are arrays stored in memory?
- Each element is stored at a random memory location.
- All elements are stored in a contiguous block of memory.
- Arrays are stored in reverse order.
- Elements are dynamically linked to the next element in memory.
What are the disadvantages of static arrays?
- Data structures like queue or stack cannot be implemented
- There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated size
- Index value of an array can be negative
- Elements are sequentially accessed
How are elements of dynamic array stored in the memory
- Each element is stored at a random memory location.
- Elements are dynamically linked to the next element in memory.
- Each element is stored in a contiguous memory locations
- Elements are grouped and each group is stored at a random memory location .
What is the difference between declaring and initializing an array?
Declaring an array specifies its size, while initialization gives it values
Initialization creates an empty array, and declaration assigns values to it
Declaring an array also initializes it to default values
There is no difference between declaring and initializing an array
An array where each element is a single value.
An array that stores elements is a single row.
an array of arrays or a matrix consisting of rows and columns.
An array that contains only integers.
How are the elements accessed in a 2d array ?
What is the time complexity for inserting/deleting at the beginning of the array?
There are 20 questions to complete.
Take a part in the ongoing discussion