ARRAY

1| What is an array?
An array is a data structure consisting of a collection of elements (values or variables), each identified by at least one array index or key.

2| What is an indexed array?
An indexed array is an array that uses a numeric index to access its elements. It is also known as a numerical array.

3| What is an associative array?
An associative array is an array that uses named keys that you assign to it. It is also known as a dictionary, hash map, or symbol table.

4| What are the different types of arrays?
The different types of arrays include indexed arrays, associative arrays, multi-dimensional arrays, and jagged arrays.

5| What are the advantages of using an array?
The advantages of using an array include the ability to store and retrieve data quickly, the ability to sort data, and the ability to perform mathematical operations on the data.

6| What are the disadvantages of using an array?
The disadvantages of using an array include the need to know the size of the array before it is created, the need to use extra memory for storing the array, and the need to use extra time for searching and sorting data.

7| What is the difference between an array and a linked list?
The difference between an array and a linked list is that an array is stored in a contiguous block of memory, while a linked list is stored in non-contiguous blocks of memory.

8| How do you declare an array in C++?
In C++, an array can be declared using the syntax “type arrayName[size]”, where type is the data type of the elements in the array, arrayName is the name of the array, and size is the size of the array.

9| What is the difference between an array and a matrix?
The difference between an array and a matrix is that an array is a one-dimensional collection of elements, while a matrix is a two-dimensional collection of elements.

10| How do you access elements in an array?
Elements in an array can be accessed using their index. The syntax for accessing an element in an array is “arrayName[index]”, where arrayName is the name of the array and index is the index of the element that you want to access.

x