0% found this document useful (0 votes)
2K views3 pages

Array Handwritten Notes

An array is a data structure that stores a fixed-size sequence of homogeneous elements in contiguous memory locations. It can be one-dimensional or multi-dimensional, and common operations include access, insertion, deletion, and traversal. While arrays provide fast access times, their fixed size can lead to wasted space or overflow, and insertion and deletion can be costly.

Uploaded by

samarthsharma866
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)
2K views3 pages

Array Handwritten Notes

An array is a data structure that stores a fixed-size sequence of homogeneous elements in contiguous memory locations. It can be one-dimensional or multi-dimensional, and common operations include access, insertion, deletion, and traversal. While arrays provide fast access times, their fixed size can lead to wasted space or overflow, and insertion and deletion can be costly.

Uploaded by

samarthsharma866
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
You are on page 1/ 3

Shubham Upadhyay

DATE

ARRAY PAGE

An asay is q data structuxe that stores


a tixed- Size sequehce of elements of the
Same type. Hexe axe some key points about
azays:
Chaxactexistics
1- Fixed Size:
The size of an axray is deined at the time
of czeation and cannot be changed.
2- Homcogeneous Elements:
AII elements in qn arzay are of the same
data type (e-g., integers, floats, Staings).
3 Contiquous
ContiOUS Memoxy:
Elements ave stoxed in contiguous memory
locations, allowing fox efficent access.
Types of Arzays
1- One-Dimensional Axays A lineas list of
elements.
Example: int qxsL51-{1,2,3,4,5};
Shubham Upadhyay
DATE.
PAGE

2.. Multi-Dimension al Arzays:


Azxays of axzays, commonly used fox matzices:
Example: int matzix [31[3]= {1,2,33,{4,5, 63,
{, 8, 93;
Common Opexationsi
Access: Retrieve an element using its index.
Ceg,aCo1).

Insestion: Add elerments (usually zequives


shifting).
Deletion: Remove elements (also requives shifing
Tyaversal: Loop thxough all elements.
Pxos Qnd Cons

Pros:
Fast access time (O(1) for indexing).
Simple to implement.
Cons:
|Fixed size can lead to wasted space ox overflow.
Insestion deletionCon be castly(0Cn).
Shubham Upadhyay
DATE
PAGE

Use Coases :

Stosing collections of data Clike lists of


numbes).

Implementing other data structures Clike


stacks , queves, and matzices).

You might also like