SlideShare a Scribd company logo
It Is An Ordered List, Which Consist Of 
A Fixed Number Of Homogeneous Data 
Items (Elements).An Array Is A Primitive 
Data Structure. These Elements Are 
Stored In Successive Memory Locations 
According To Size Of Data Type. Array Is 
Also Referred As Set Of (Index , Value).
(index) 
A[0] A[1] A[2] A[3] A[4] A[5] A[MAX -1] 
10 5 46 2 100 97 ... 
Data element value
The Insert Operation Is Performed By 
Shifting All The Elements One Position 
Ahead From Index iTo N-1 Where i Is The 
Specified Index For New Element Is To Be 
Inserted. And Adding The New Element To 
The Array At The Specified Index Position.
For example, 
index for insertion is i=2 and new element is 17 with N=6. the 
MAX is the size of the array A. 
A[0] A[1] A[2] … A[N-1] A[MAX-1] 
10 5 46 2 100 97 … 
Insert index position 
Move All Elements From Insert Index Position I N-1 Towards Right By One Position 
A[0] 1 2 3 4 5 A[6] A[MAX-1] 
10 5 46 2 100 97 … 
Insert Index Position
A[0] 1 2 3 4 5 A[6] A[MAX-1] 
10 5 46 46 2 100 97 … 
Insert index position 
Shifted elements
Now, insert (store) new data element 17 at given index position 2: 
A[0] 1 2 3 4 5 A[6] A[MAX-1] 
10 5 17 46 2 100 97 … 
Inserted element 
For Every New Element Inserted The Number Of Elements 
I.E N Should Be Incremented By 1. If N= Max-1 Then Array 
Is Full And Insertion Operation Cannot Be Performed As 
There Is No Space For New Element In The Array.
The delete operation will delete the element at 
specified element index from one-dimensional array. 
The deletion operation performed by shifting all the 
elements one position before from index i=1 to N-1 
where i is the index of element to be deleted. A[i] = 
A[i+1], for all i to N-1 . This shifting causes 
overwriting of the said element with element at next 
index position.
For example, 
For an array N=7 and index position for deletion is 
i=3 and maximum array size as MAX. 
A[0] 1 2 3 4 5 A[6] A[MAX-1] 
10 5 17 46 2 100 97 … 
Delete Index Position 
Now , Shift All Element From Index 4 To 6 One Position Before As Below: 
A[0] 1 2 3 4 5 A[6] A[MAX-1] 
10 5 17 46 2 100 97 … 
Element At Index 3 
The Array After The Shifting Backward Is:
A[0] 1 2 3 4 A[5] A[MAX-1] 
10 5 17 2 100 97 97 … 
Last element of array 
The element 46 is deleted from the array. After every 
delete operation the number of elements N should be 
decrement by 1. if array is empty , the deletion operation 
cannot be performed .
Array operations

More Related Content

What's hot

Infix to postfix conversion
Infix to postfix conversionInfix to postfix conversion
Infix to postfix conversion
Then Murugeshwari
 
Pointer in C++
Pointer in C++Pointer in C++
Pointer in C++
Mauryasuraj98
 
Binary search tree(bst)
Binary search tree(bst)Binary search tree(bst)
Binary search tree(bst)
Hossain Md Shakhawat
 
Circular link list.ppt
Circular link list.pptCircular link list.ppt
Circular link list.ppt
Tirthika Bandi
 
Sparse matrix and its representation data structure
Sparse matrix and its representation data structureSparse matrix and its representation data structure
Sparse matrix and its representation data structure
Vardhil Patel
 
RECURSION IN C
RECURSION IN C RECURSION IN C
RECURSION IN C
v_jk
 
heap Sort Algorithm
heap  Sort Algorithmheap  Sort Algorithm
heap Sort Algorithm
Lemia Algmri
 
Linked List
Linked ListLinked List
Linked List
RaaviKapoor
 
Data Structure (Queue)
Data Structure (Queue)Data Structure (Queue)
Data Structure (Queue)
Adam Mukharil Bachtiar
 
Data structures using c
Data structures using cData structures using c
Data structures using c
Prof. Dr. K. Adisesha
 
Queue ppt
Queue pptQueue ppt
Queue ppt
SouravKumar328
 
Lec 17 heap data structure
Lec 17 heap data structureLec 17 heap data structure
Lec 17 heap data structure
Sajid Marwat
 
Pointer in c
Pointer in cPointer in c
Pointer in c
lavanya marichamy
 
2. Array in Data Structure
2. Array in Data Structure2. Array in Data Structure
2. Array in Data Structure
Mandeep Singh
 
Stack
StackStack
Infix prefix postfix
Infix prefix postfixInfix prefix postfix
Infix prefix postfix
Self-Employed
 
Data structures
Data structuresData structures
Data structures
Naresh Babu Merugu
 
File in C language
File in C languageFile in C language
File in C language
Manash Kumar Mondal
 
Hashing in datastructure
Hashing in datastructureHashing in datastructure
Hashing in datastructure
rajshreemuthiah
 
Linked list
Linked listLinked list
Linked list
KalaivaniKS1
 

What's hot (20)

Infix to postfix conversion
Infix to postfix conversionInfix to postfix conversion
Infix to postfix conversion
 
Pointer in C++
Pointer in C++Pointer in C++
Pointer in C++
 
Binary search tree(bst)
Binary search tree(bst)Binary search tree(bst)
Binary search tree(bst)
 
Circular link list.ppt
Circular link list.pptCircular link list.ppt
Circular link list.ppt
 
Sparse matrix and its representation data structure
Sparse matrix and its representation data structureSparse matrix and its representation data structure
Sparse matrix and its representation data structure
 
RECURSION IN C
RECURSION IN C RECURSION IN C
RECURSION IN C
 
heap Sort Algorithm
heap  Sort Algorithmheap  Sort Algorithm
heap Sort Algorithm
 
Linked List
Linked ListLinked List
Linked List
 
Data Structure (Queue)
Data Structure (Queue)Data Structure (Queue)
Data Structure (Queue)
 
Data structures using c
Data structures using cData structures using c
Data structures using c
 
Queue ppt
Queue pptQueue ppt
Queue ppt
 
Lec 17 heap data structure
Lec 17 heap data structureLec 17 heap data structure
Lec 17 heap data structure
 
Pointer in c
Pointer in cPointer in c
Pointer in c
 
2. Array in Data Structure
2. Array in Data Structure2. Array in Data Structure
2. Array in Data Structure
 
Stack
StackStack
Stack
 
Infix prefix postfix
Infix prefix postfixInfix prefix postfix
Infix prefix postfix
 
Data structures
Data structuresData structures
Data structures
 
File in C language
File in C languageFile in C language
File in C language
 
Hashing in datastructure
Hashing in datastructureHashing in datastructure
Hashing in datastructure
 
Linked list
Linked listLinked list
Linked list
 

Viewers also liked

القوائم المترابطة Linked List باستخدام لغة جافا
القوائم المترابطة Linked List باستخدام لغة جافاالقوائم المترابطة Linked List باستخدام لغة جافا
القوائم المترابطة Linked List باستخدام لغة جافا
Mahmoud Alfarra
 
Queue Data Structure
Queue Data StructureQueue Data Structure
Queue Data Structure
Sriram Raj
 
المحاضرة الثامنة: تراكيب البيانات الطابور
المحاضرة الثامنة: تراكيب البيانات الطابورالمحاضرة الثامنة: تراكيب البيانات الطابور
المحاضرة الثامنة: تراكيب البيانات الطابور
Mahmoud Alfarra
 
3 Array operations
3   Array operations3   Array operations
3 Array operations
Mahmoud Alfarra
 
1 intro of data structure course
1  intro of data structure course1  intro of data structure course
1 intro of data structure course
Mahmoud Alfarra
 
2 introduction to data structure
2  introduction to data structure2  introduction to data structure
2 introduction to data structure
Mahmoud Alfarra
 
Multidimensional array in C
Multidimensional array in CMultidimensional array in C
Multidimensional array in C
Smit Parikh
 
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakarData structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Obaid Kakar
 

Viewers also liked (8)

القوائم المترابطة Linked List باستخدام لغة جافا
القوائم المترابطة Linked List باستخدام لغة جافاالقوائم المترابطة Linked List باستخدام لغة جافا
القوائم المترابطة Linked List باستخدام لغة جافا
 
Queue Data Structure
Queue Data StructureQueue Data Structure
Queue Data Structure
 
المحاضرة الثامنة: تراكيب البيانات الطابور
المحاضرة الثامنة: تراكيب البيانات الطابورالمحاضرة الثامنة: تراكيب البيانات الطابور
المحاضرة الثامنة: تراكيب البيانات الطابور
 
3 Array operations
3   Array operations3   Array operations
3 Array operations
 
1 intro of data structure course
1  intro of data structure course1  intro of data structure course
1 intro of data structure course
 
2 introduction to data structure
2  introduction to data structure2  introduction to data structure
2 introduction to data structure
 
Multidimensional array in C
Multidimensional array in CMultidimensional array in C
Multidimensional array in C
 
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakarData structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
 

Similar to Array operations

A sorted linear array
A sorted linear array A sorted linear array
A sorted linear array
Suneel Dogra
 
AD3251-LINKED LIST,STACK ADT,QUEUE ADT.docx
AD3251-LINKED LIST,STACK ADT,QUEUE ADT.docxAD3251-LINKED LIST,STACK ADT,QUEUE ADT.docx
AD3251-LINKED LIST,STACK ADT,QUEUE ADT.docx
AmuthachenthiruK
 
Sorting techniques
Sorting techniquesSorting techniques
Sorting techniques
Sukhvinder Singh
 
Insertion and Redix Sort
Insertion and Redix SortInsertion and Redix Sort
Insertion and Redix Sort
Sukhvinder Singh
 
DSA Unit II array.pptx
DSA Unit II array.pptxDSA Unit II array.pptx
DSA Unit II array.pptx
sayalishivarkar1
 
linked list (c#)
 linked list (c#) linked list (c#)
linked list (c#)
swajahatr
 
MODULE 5-Searching and-sorting
MODULE 5-Searching and-sortingMODULE 5-Searching and-sorting
MODULE 5-Searching and-sorting
nikshaikh786
 
Linked list
Linked listLinked list
Linked list
Luis Goldster
 
Linked list
Linked listLinked list
Linked list
Young Alista
 
Linked list
Linked listLinked list
Linked list
Tony Nguyen
 
Linked list
Linked listLinked list
Linked list
Harry Potter
 
Linked list
Linked listLinked list
Linked list
James Wong
 
Linked list
Linked listLinked list
Linked list
Hoang Nguyen
 
Linked list
Linked listLinked list
Linked list
Fraboni Ec
 
Array Presentation
Array PresentationArray Presentation
Array Presentation
Deep Prajapati Microplacer
 
Arrays.pptx
Arrays.pptxArrays.pptx
Arrays.pptx
Koteswari Kasireddy
 
Arrays
ArraysArrays
DATA STRUCTURE CLASS 12 COMPUTER SCIENCE
DATA STRUCTURE CLASS 12 COMPUTER SCIENCEDATA STRUCTURE CLASS 12 COMPUTER SCIENCE
DATA STRUCTURE CLASS 12 COMPUTER SCIENCE
Dev Chauhan
 
arrays
arraysarrays
List - Operations and Implementation
List - Operations and ImplementationList - Operations and Implementation
List - Operations and Implementation
Sagacious IT Solution
 

Similar to Array operations (20)

A sorted linear array
A sorted linear array A sorted linear array
A sorted linear array
 
AD3251-LINKED LIST,STACK ADT,QUEUE ADT.docx
AD3251-LINKED LIST,STACK ADT,QUEUE ADT.docxAD3251-LINKED LIST,STACK ADT,QUEUE ADT.docx
AD3251-LINKED LIST,STACK ADT,QUEUE ADT.docx
 
Sorting techniques
Sorting techniquesSorting techniques
Sorting techniques
 
Insertion and Redix Sort
Insertion and Redix SortInsertion and Redix Sort
Insertion and Redix Sort
 
DSA Unit II array.pptx
DSA Unit II array.pptxDSA Unit II array.pptx
DSA Unit II array.pptx
 
linked list (c#)
 linked list (c#) linked list (c#)
linked list (c#)
 
MODULE 5-Searching and-sorting
MODULE 5-Searching and-sortingMODULE 5-Searching and-sorting
MODULE 5-Searching and-sorting
 
Linked list
Linked listLinked list
Linked list
 
Linked list
Linked listLinked list
Linked list
 
Linked list
Linked listLinked list
Linked list
 
Linked list
Linked listLinked list
Linked list
 
Linked list
Linked listLinked list
Linked list
 
Linked list
Linked listLinked list
Linked list
 
Linked list
Linked listLinked list
Linked list
 
Array Presentation
Array PresentationArray Presentation
Array Presentation
 
Arrays.pptx
Arrays.pptxArrays.pptx
Arrays.pptx
 
Arrays
ArraysArrays
Arrays
 
DATA STRUCTURE CLASS 12 COMPUTER SCIENCE
DATA STRUCTURE CLASS 12 COMPUTER SCIENCEDATA STRUCTURE CLASS 12 COMPUTER SCIENCE
DATA STRUCTURE CLASS 12 COMPUTER SCIENCE
 
arrays
arraysarrays
arrays
 
List - Operations and Implementation
List - Operations and ImplementationList - Operations and Implementation
List - Operations and Implementation
 

Recently uploaded

22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
Madan Karki
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
mahammadsalmanmech
 
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
awadeshbabu
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
Rahul
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
camseq
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
ClaraZara1
 
Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
mamunhossenbd75
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt
PuktoonEngr
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
gerogepatton
 
Low power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniquesLow power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniques
nooriasukmaningtyas
 
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdfIron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
RadiNasr
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
SyedAbiiAzazi1
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
JamalHussainArman
 

Recently uploaded (20)

22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
 
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
 
Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
 
Low power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniquesLow power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniques
 
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdfIron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
 

Array operations

  • 1.
  • 2. It Is An Ordered List, Which Consist Of A Fixed Number Of Homogeneous Data Items (Elements).An Array Is A Primitive Data Structure. These Elements Are Stored In Successive Memory Locations According To Size Of Data Type. Array Is Also Referred As Set Of (Index , Value).
  • 3. (index) A[0] A[1] A[2] A[3] A[4] A[5] A[MAX -1] 10 5 46 2 100 97 ... Data element value
  • 4. The Insert Operation Is Performed By Shifting All The Elements One Position Ahead From Index iTo N-1 Where i Is The Specified Index For New Element Is To Be Inserted. And Adding The New Element To The Array At The Specified Index Position.
  • 5. For example, index for insertion is i=2 and new element is 17 with N=6. the MAX is the size of the array A. A[0] A[1] A[2] … A[N-1] A[MAX-1] 10 5 46 2 100 97 … Insert index position Move All Elements From Insert Index Position I N-1 Towards Right By One Position A[0] 1 2 3 4 5 A[6] A[MAX-1] 10 5 46 2 100 97 … Insert Index Position
  • 6. A[0] 1 2 3 4 5 A[6] A[MAX-1] 10 5 46 46 2 100 97 … Insert index position Shifted elements
  • 7. Now, insert (store) new data element 17 at given index position 2: A[0] 1 2 3 4 5 A[6] A[MAX-1] 10 5 17 46 2 100 97 … Inserted element For Every New Element Inserted The Number Of Elements I.E N Should Be Incremented By 1. If N= Max-1 Then Array Is Full And Insertion Operation Cannot Be Performed As There Is No Space For New Element In The Array.
  • 8. The delete operation will delete the element at specified element index from one-dimensional array. The deletion operation performed by shifting all the elements one position before from index i=1 to N-1 where i is the index of element to be deleted. A[i] = A[i+1], for all i to N-1 . This shifting causes overwriting of the said element with element at next index position.
  • 9. For example, For an array N=7 and index position for deletion is i=3 and maximum array size as MAX. A[0] 1 2 3 4 5 A[6] A[MAX-1] 10 5 17 46 2 100 97 … Delete Index Position Now , Shift All Element From Index 4 To 6 One Position Before As Below: A[0] 1 2 3 4 5 A[6] A[MAX-1] 10 5 17 46 2 100 97 … Element At Index 3 The Array After The Shifting Backward Is:
  • 10. A[0] 1 2 3 4 A[5] A[MAX-1] 10 5 17 2 100 97 97 … Last element of array The element 46 is deleted from the array. After every delete operation the number of elements N should be decrement by 1. if array is empty , the deletion operation cannot be performed .