0% found this document useful (0 votes)
5 views7 pages

Array

The document outlines the concept of arrays as a linear non-primitive data structure and details various operations such as creation, insertion, deletion, and searching. It also includes a pseudo code for reversing an array, demonstrating how to swap elements from both ends until the middle is reached. Additionally, it discusses the total capacity and size of an array in relation to element insertion.
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)
5 views7 pages

Array

The document outlines the concept of arrays as a linear non-primitive data structure and details various operations such as creation, insertion, deletion, and searching. It also includes a pseudo code for reversing an array, demonstrating how to swap elements from both ends until the middle is reached. Additionally, it discusses the total capacity and size of an array in relation to element insertion.
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

Array

[Linear Data structure


Non Primitive Data Stucture]
Array Operations
• Creation
• Insertion
at beginning
at end
at any position
• Deletion
at beginning
at end
at any position
• Searching
Array Total Capacity

Size of an array

Element to be inserted
Element to be inserted

Shifting
Insert the element at Array printing
starting index

Element to be inserted
Position index

Insert the element at


shifts all elements to the right upto
position index
position index
Reverse of an array
Reverse of an Array
Pseudo code: Reverse of an array
BEGIN
READ n
READ array A[0…n−1]

i←0
j←n−1

WHILE i < j DO
SWAP A[i], A[j]
i←i+1
j←j−1
END WHILE

PRINT A
END

You might also like