0% found this document useful (0 votes)
4 views12 pages

Array

The document provides an overview of arrays, explaining their definition, types (1D, 2D, and multi-dimensional), and key operations such as declaration, initialization, insertion, and deletion. It also includes real-life examples of arrays and discusses how they are stored in memory. The document is structured to educate readers on the fundamental concepts and operations related to arrays in programming.

Uploaded by

j25aiml025
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views12 pages

Array

The document provides an overview of arrays, explaining their definition, types (1D, 2D, and multi-dimensional), and key operations such as declaration, initialization, insertion, and deletion. It also includes real-life examples of arrays and discusses how they are stored in memory. The document is structured to educate readers on the fundamental concepts and operations related to arrays in programming.

Uploaded by

j25aiml025
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

JSS UNIVERSITY NOIDA

Members:
1. Arushi Joshi
ARRAY 2. Yati Rastogi
3. Deepti Singh
4. Kashish Sharma
WHAT IS AN ARRAY?
An array is a collection of elements of the same data type stored at continuous memory locations.

KEY POINTS TYPES OF ARRAY


1. One-Dimensional Array (1D Array)
All elements must be of the This is the simplest type.
same type (like all Uses only one index
Represents a list of elements
integers).
Each element is accessed 2. Two-Dimensional Array (2D Array)
using an index (position). Uses two indices (row and column)
Index starts from 0. Represents a table or matrix

3. Multi-Dimensional Array
More than 2 dimensions (3D, 4D, etc.)
Used in complex applications
Array Declaration
Declaration means creating an array by specifying data types, array name,
size
Array Initialization DECLARATION &
Initialization means assigning values to the array.
INITIALIZATION
REAL-LIFE EXAMPLES OF ARRAYS
Arrays are all about storing similar items together in an ordered way. we actually see this
concept everywhere in real life—just without calling it an “array.”
The following are some relatable examples.

CONTACTS IN A DAYS OF THE TEMPERATURE ATTENDANCE


PHONE WEEK RECORD OF STUDENTS
Contacts are stored in Names of days can Daily temperatures of a Attendance can be
a list where each be stored in an array. week can be stored in stored as present
contact has a fixed an array.
(1) or absent (0).
position.
1. Insertion at Beginning
The new element is inserted at the first position (index 0).
All existing elements are shifted one position to the right.
ARRAY
INSERTION
Array insertion means adding a new element
into an existing array at a specific position.
Since arrays have fixed size, insertion may
require shifting elements to make space.

2. Insertion at Specific Position


The element is inserted at a given position, and elements after that position are shifted.
3. Insertion at End
The element is added at the last position.
No shifting is required.
COMPARISON
1. Deletion from Beginning
The first element (index 0) is removed.
All remaining elements are shifted one position to the left.
ARRAY
DELETION
Array deletion means removing an element
from an array at a specific position.
After deletion, elements are shifted left to fill
the empty space.

[Link] from Middle (Specific Position)


An element at a given position is removed, and remaining elements are shifted.
[Link] from End
The last element is removed.
No shifting is required.
COMPARISON
WHAT IS MEMORY
ADDRESS?
A memory address is the location of a variable in
computer memory (RAM). Each house has a HOW ARRAYS ARE
unique address and each variable in memory also STORED IN MEMORY?
has a unique address
Arrays are stored in contiguous memory
locations. All elements are placed next to each
other in sequence
The base address is the address of the first
element of the array.
THANK YOU

You might also like