<aside> <img src="/icons/table_red.svg" alt="/icons/table_red.svg" width="40px" /> Table of Contents
</aside>
<aside> 💡
<aside> 💡
</aside>
Arrays: Basics of Arrays, Operations on Arrays
Basics of Arrays
What is an Array?
An array is a collection of elements, all of the same data type, stored in contiguous memory locations. It allows indexed access to its elements, which makes operations like traversal and searching efficient.
Key Characteristics:
Example:
An array of integers to store the marks of five students:
Index: 0 1 2 3 4
Marks: 85 90 78 92 88
Why Use Arrays?
Types of Arrays
[10, 20, 30, 40, 50]
Example: A 2x3 matrix:
1 2 3
4 5 6