This quiz in arrays covers key concepts like array creation, manipulation, and common operations, it's designed to help you strengthen your understanding of one of the most fundamental data structures in programming.
Question 1
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.
Question 3
Which method is used to access elements in an array?
Sequential
Random
Logarithmic
Alternative
Question 4
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.
Question 5
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
Question 6
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 .
Question 7
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
Question 8
What is a 2d 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.
Question 9
How are the elements accessed in a 2d array ?
array(i, j)
array[i, j]
array[ i ][ j ]
array{ i }{ j }
Question 10
What is the time complexity for inserting/deleting at the beginning of the array?
O(1)
O(N log N)
O(log N)
O(N)
There are 20 questions to complete.