Lecture 2
Lecture 2
2
Key Characteristics of Arrays
Fixed Size: Once an array is declared, its size cannot be changed.
4
Limitations of Arrays
• Fixed size: Cannot grow or shrink dynamically.
• Insertion and deletion operations are costly (require
shifting elements).
• Stores only homogeneous data types.
5
Applications of Arrays
• Database Systems: Storing rows and columns of a
table.
• Image Processing: Representing images as 2D arrays
(pixels).
• Data Analysis: Representing datasets in tabular form.
• Mathematics: Storing matrices for linear algebra.
6
Types of Arrays
• One-Dimensional Arrays:
A single row of elements.
Example: [10, 20, 30, 40, 50].
• Multi-Dimensional Arrays:
Arrays with more than one dimension (e.g., 2D, 3D arrays).
2D Array Example (Matrix).