Arrays and Types of Arrays
Arrays in Programming
---------------------
An array is a data structure used to store multiple values of the same type in a single variable.
Arrays are commonly used in many programming languages such as C, C++, Java, and Python.
Types of Arrays
===============
1. One-Dimensional Array
------------------------
A linear list of elements.
Example: int arr[5] = {1, 2, 3, 4, 5};
2. Two-Dimensional Array
------------------------
A table or matrix-like structure (rows and columns).
Example: int matrix[2][3] = {{1, 2, 3}, {4, 5, 6}};
3. Multi-Dimensional Array
--------------------------
An array with more than two dimensions.
Example: int arr[2][2][3];
4. Dynamic Array
----------------
Size can be changed during runtime.
Example (C++ using vectors): vector<int> v;
5. Jagged Array
---------------
An array of arrays where inner arrays can have different lengths.
Example (Java): int[][] jagged = new int[3][];
6. Character Array (String)
---------------------------
Special array used to store characters.
Example: char name[10] = "Alice";