SlideShare a Scribd company logo
1 of 8
Deletion Operation in Array(DS)
Prof. Neeraj Bhargava
Kapil Chauhan
Department of Computer Science
School of Engineering & Systems Sciences
MDS University, Ajmer
Deletion Operation in Array
 It is a process of deleting a particular element from an array.
 If an element to be deleted ith location then all elements from
the (i+1)th location we have to be shifted one step towards left.
 So (i+1)th element is copied to ith location and (i+2)th to (i+1)th
location and so on.
Algorithm For Deletion Operation in Array
 Deletion in the operation in which a value is deleted
at a particular place in an array.
Cont..
In the below diagram , we have deleted E element form the array and rewrite
New array.
Algorithm For Deletion In An Array
 Algorithm: In this algorithm a value is being deleted
from ith location of an array Reg[N].
 Let us assume that last element in the array is at Mth
position.
Steps
1. Back=i
2. While (Back<M) repeat 3 and 4
3. Reg[Back]= Reg[Back+1]
4. Back= Back+1
5. M=M-1
6. End
Example
Explaination
 Steps
1. Back=i => Back=5
2. While(Back<M) repeat step 3 to 4
=> 5<8 true
3. Reg[Back]=Reg[Back+1]
Reg[5]=>Reg[6]=> reg[5]=20
4. Back=Back+1
Now Back =6
again step 3.
Reg[6]=Reg[6=1]
= 28
step 4: Back=Back+1 =>7
again step 3 until Back<M
5. M=M-1
=8-1=>7
6. End.
Assignment
 Explain insertion of element of specific position in
array. Discuss all the steps of algorithm with an
example.

More Related Content

What's hot

Presentation on the topic selection sort
Presentation on the topic selection sortPresentation on the topic selection sort
Presentation on the topic selection sortDistrict Administration
 
Array Introduction One-dimensional array Multidimensional array
Array Introduction One-dimensional array Multidimensional arrayArray Introduction One-dimensional array Multidimensional array
Array Introduction One-dimensional array Multidimensional arrayimtiazalijoono
 
STACKS IN DATASTRUCTURE
STACKS IN DATASTRUCTURESTACKS IN DATASTRUCTURE
STACKS IN DATASTRUCTUREArchie Jamwal
 
Data Structures (CS8391)
Data Structures (CS8391)Data Structures (CS8391)
Data Structures (CS8391)Elavarasi K
 
Data types and Operators
Data types and OperatorsData types and Operators
Data types and Operatorsraksharao
 
Two dimensional arrays
Two dimensional arraysTwo dimensional arrays
Two dimensional arraysNeeru Mittal
 
Queue in Data Structure
Queue in Data Structure Queue in Data Structure
Queue in Data Structure Janki Shah
 
Stack Data Structure & It's Application
Stack Data Structure & It's Application Stack Data Structure & It's Application
Stack Data Structure & It's Application Tech_MX
 
Arrays Data Structure
Arrays Data StructureArrays Data Structure
Arrays Data Structurestudent
 
Polymorphism in c++(ppt)
Polymorphism in c++(ppt)Polymorphism in c++(ppt)
Polymorphism in c++(ppt)Sanjit Shaw
 
Ppt on Linked list,stack,queue
Ppt on Linked list,stack,queuePpt on Linked list,stack,queue
Ppt on Linked list,stack,queueSrajan Shukla
 
Queue - Data Structure - Notes
Queue - Data Structure - NotesQueue - Data Structure - Notes
Queue - Data Structure - NotesOmprakash Chauhan
 
Inheritance in java
Inheritance in java Inheritance in java
Inheritance in java yash jain
 

What's hot (20)

Presentation on the topic selection sort
Presentation on the topic selection sortPresentation on the topic selection sort
Presentation on the topic selection sort
 
Pointers in C Programming
Pointers in C ProgrammingPointers in C Programming
Pointers in C Programming
 
Array Introduction One-dimensional array Multidimensional array
Array Introduction One-dimensional array Multidimensional arrayArray Introduction One-dimensional array Multidimensional array
Array Introduction One-dimensional array Multidimensional array
 
STACKS IN DATASTRUCTURE
STACKS IN DATASTRUCTURESTACKS IN DATASTRUCTURE
STACKS IN DATASTRUCTURE
 
Data Structures (CS8391)
Data Structures (CS8391)Data Structures (CS8391)
Data Structures (CS8391)
 
Data types and Operators
Data types and OperatorsData types and Operators
Data types and Operators
 
Two dimensional arrays
Two dimensional arraysTwo dimensional arrays
Two dimensional arrays
 
Queue in Data Structure
Queue in Data Structure Queue in Data Structure
Queue in Data Structure
 
Stack Data Structure & It's Application
Stack Data Structure & It's Application Stack Data Structure & It's Application
Stack Data Structure & It's Application
 
Arrays Data Structure
Arrays Data StructureArrays Data Structure
Arrays Data Structure
 
Polymorphism in c++(ppt)
Polymorphism in c++(ppt)Polymorphism in c++(ppt)
Polymorphism in c++(ppt)
 
Data Structure (Queue)
Data Structure (Queue)Data Structure (Queue)
Data Structure (Queue)
 
Java(Polymorphism)
Java(Polymorphism)Java(Polymorphism)
Java(Polymorphism)
 
Queues
QueuesQueues
Queues
 
stack presentation
stack presentationstack presentation
stack presentation
 
Linear search-and-binary-search
Linear search-and-binary-searchLinear search-and-binary-search
Linear search-and-binary-search
 
Ppt on Linked list,stack,queue
Ppt on Linked list,stack,queuePpt on Linked list,stack,queue
Ppt on Linked list,stack,queue
 
Queue - Data Structure - Notes
Queue - Data Structure - NotesQueue - Data Structure - Notes
Queue - Data Structure - Notes
 
Arrays in Java
Arrays in JavaArrays in Java
Arrays in Java
 
Inheritance in java
Inheritance in java Inheritance in java
Inheritance in java
 

Similar to Deletion operation in array(ds)

DAA-Divide and Conquer methodology, DAA 2024
DAA-Divide and Conquer methodology, DAA 2024DAA-Divide and Conquer methodology, DAA 2024
DAA-Divide and Conquer methodology, DAA 2024RUHULAMINHAZARIKA
 
Dsa – data structure and algorithms sorting
Dsa – data structure and algorithms  sortingDsa – data structure and algorithms  sorting
Dsa – data structure and algorithms sortingsajinis3
 
An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...
An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...
An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...Tosin Amuda
 
Quicksort AlgorithmQuicksort is a divide and conquer algorithm. Q.pdf
Quicksort AlgorithmQuicksort is a divide and conquer algorithm. Q.pdfQuicksort AlgorithmQuicksort is a divide and conquer algorithm. Q.pdf
Quicksort AlgorithmQuicksort is a divide and conquer algorithm. Q.pdfanupamfootwear
 
Searching in Data Structure
Searching in Data StructureSearching in Data Structure
Searching in Data Structureraghavbirla63
 
358 33 powerpoint-slides_14-sorting_chapter-14
358 33 powerpoint-slides_14-sorting_chapter-14358 33 powerpoint-slides_14-sorting_chapter-14
358 33 powerpoint-slides_14-sorting_chapter-14sumitbardhan
 
Matlab matrices and arrays
Matlab matrices and arraysMatlab matrices and arrays
Matlab matrices and arraysAmeen San
 
Searching techniques with progrms
Searching techniques with progrmsSearching techniques with progrms
Searching techniques with progrmsMisssaxena
 
Data structures arrays
Data structures   arraysData structures   arrays
Data structures arraysmaamir farooq
 
Data structure using c module 1
Data structure using c module 1Data structure using c module 1
Data structure using c module 1smruti sarangi
 

Similar to Deletion operation in array(ds) (20)

DAA-Divide and Conquer methodology, DAA 2024
DAA-Divide and Conquer methodology, DAA 2024DAA-Divide and Conquer methodology, DAA 2024
DAA-Divide and Conquer methodology, DAA 2024
 
Ada notes
Ada notesAda notes
Ada notes
 
Dsa – data structure and algorithms sorting
Dsa – data structure and algorithms  sortingDsa – data structure and algorithms  sorting
Dsa – data structure and algorithms sorting
 
Sorting.ppt read only
Sorting.ppt read onlySorting.ppt read only
Sorting.ppt read only
 
An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...
An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...
An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...
 
Quicksort AlgorithmQuicksort is a divide and conquer algorithm. Q.pdf
Quicksort AlgorithmQuicksort is a divide and conquer algorithm. Q.pdfQuicksort AlgorithmQuicksort is a divide and conquer algorithm. Q.pdf
Quicksort AlgorithmQuicksort is a divide and conquer algorithm. Q.pdf
 
1D Array
1D Array1D Array
1D Array
 
Searching in Data Structure
Searching in Data StructureSearching in Data Structure
Searching in Data Structure
 
358 33 powerpoint-slides_14-sorting_chapter-14
358 33 powerpoint-slides_14-sorting_chapter-14358 33 powerpoint-slides_14-sorting_chapter-14
358 33 powerpoint-slides_14-sorting_chapter-14
 
Insertion sort
Insertion sortInsertion sort
Insertion sort
 
Matlab matrices and arrays
Matlab matrices and arraysMatlab matrices and arrays
Matlab matrices and arrays
 
Searching techniques with progrms
Searching techniques with progrmsSearching techniques with progrms
Searching techniques with progrms
 
Data structures arrays
Data structures   arraysData structures   arrays
Data structures arrays
 
advanced algo
advanced algoadvanced algo
advanced algo
 
Data structure using c module 1
Data structure using c module 1Data structure using c module 1
Data structure using c module 1
 
Lect-2.pptx
Lect-2.pptxLect-2.pptx
Lect-2.pptx
 
Sorting
SortingSorting
Sorting
 
Sorting
SortingSorting
Sorting
 
Matrices
MatricesMatrices
Matrices
 
Daa chapter5
Daa chapter5Daa chapter5
Daa chapter5
 

More from chauhankapil

Gray level transformation
Gray level transformationGray level transformation
Gray level transformationchauhankapil
 
Elements of visual perception
Elements of visual perceptionElements of visual perception
Elements of visual perceptionchauhankapil
 
JSP Client Request
JSP Client RequestJSP Client Request
JSP Client Requestchauhankapil
 
Jsp server response
Jsp   server responseJsp   server response
Jsp server responsechauhankapil
 
Markov decision process
Markov decision processMarkov decision process
Markov decision processchauhankapil
 
RNN basics in deep learning
RNN basics in deep learningRNN basics in deep learning
RNN basics in deep learningchauhankapil
 
Introduction to generative adversarial networks (GANs)
Introduction to generative adversarial networks (GANs)Introduction to generative adversarial networks (GANs)
Introduction to generative adversarial networks (GANs)chauhankapil
 
Bayesian probabilistic interference
Bayesian probabilistic interferenceBayesian probabilistic interference
Bayesian probabilistic interferencechauhankapil
 
Exception handling in java
Exception handling in javaException handling in java
Exception handling in javachauhankapil
 
Knowledge acquistion
Knowledge acquistionKnowledge acquistion
Knowledge acquistionchauhankapil
 
Knowledge based system
Knowledge based systemKnowledge based system
Knowledge based systemchauhankapil
 
Introduction of predicate logics
Introduction of predicate  logicsIntroduction of predicate  logics
Introduction of predicate logicschauhankapil
 
Types of inheritance in java
Types of inheritance in javaTypes of inheritance in java
Types of inheritance in javachauhankapil
 
Representation of syntax, semantics and Predicate logics
Representation of syntax, semantics and Predicate logicsRepresentation of syntax, semantics and Predicate logics
Representation of syntax, semantics and Predicate logicschauhankapil
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in javachauhankapil
 
Propositional logic
Propositional logicPropositional logic
Propositional logicchauhankapil
 
Constructors in java
Constructors in javaConstructors in java
Constructors in javachauhankapil
 
Circular linked list
Circular linked listCircular linked list
Circular linked listchauhankapil
 

More from chauhankapil (20)

Gray level transformation
Gray level transformationGray level transformation
Gray level transformation
 
Elements of visual perception
Elements of visual perceptionElements of visual perception
Elements of visual perception
 
JSP Client Request
JSP Client RequestJSP Client Request
JSP Client Request
 
Jsp server response
Jsp   server responseJsp   server response
Jsp server response
 
Markov decision process
Markov decision processMarkov decision process
Markov decision process
 
RNN basics in deep learning
RNN basics in deep learningRNN basics in deep learning
RNN basics in deep learning
 
Introduction to generative adversarial networks (GANs)
Introduction to generative adversarial networks (GANs)Introduction to generative adversarial networks (GANs)
Introduction to generative adversarial networks (GANs)
 
Bayesian probabilistic interference
Bayesian probabilistic interferenceBayesian probabilistic interference
Bayesian probabilistic interference
 
Jsp
JspJsp
Jsp
 
Exception handling in java
Exception handling in javaException handling in java
Exception handling in java
 
Knowledge acquistion
Knowledge acquistionKnowledge acquistion
Knowledge acquistion
 
Knowledge based system
Knowledge based systemKnowledge based system
Knowledge based system
 
Introduction of predicate logics
Introduction of predicate  logicsIntroduction of predicate  logics
Introduction of predicate logics
 
Types of inheritance in java
Types of inheritance in javaTypes of inheritance in java
Types of inheritance in java
 
Representation of syntax, semantics and Predicate logics
Representation of syntax, semantics and Predicate logicsRepresentation of syntax, semantics and Predicate logics
Representation of syntax, semantics and Predicate logics
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
 
Propositional logic
Propositional logicPropositional logic
Propositional logic
 
Constructors in java
Constructors in javaConstructors in java
Constructors in java
 
Methods in java
Methods in javaMethods in java
Methods in java
 
Circular linked list
Circular linked listCircular linked list
Circular linked list
 

Recently uploaded

Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...IJECEIAES
 
Databricks Generative AI Fundamentals .pdf
Databricks Generative AI Fundamentals  .pdfDatabricks Generative AI Fundamentals  .pdf
Databricks Generative AI Fundamentals .pdfVinayVadlagattu
 
Dynamo Scripts for Task IDs and Space Naming.pptx
Dynamo Scripts for Task IDs and Space Naming.pptxDynamo Scripts for Task IDs and Space Naming.pptx
Dynamo Scripts for Task IDs and Space Naming.pptxMustafa Ahmed
 
Passive Air Cooling System and Solar Water Heater.ppt
Passive Air Cooling System and Solar Water Heater.pptPassive Air Cooling System and Solar Water Heater.ppt
Passive Air Cooling System and Solar Water Heater.pptamrabdallah9
 
Working Principle of Echo Sounder and Doppler Effect.pdf
Working Principle of Echo Sounder and Doppler Effect.pdfWorking Principle of Echo Sounder and Doppler Effect.pdf
Working Principle of Echo Sounder and Doppler Effect.pdfSkNahidulIslamShrabo
 
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024EMMANUELLEFRANCEHELI
 
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdfInstruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdfEr.Sonali Nasikkar
 
Artificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdfArtificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdfKira Dess
 
Artificial Intelligence in due diligence
Artificial Intelligence in due diligenceArtificial Intelligence in due diligence
Artificial Intelligence in due diligencemahaffeycheryld
 
一比一原版(Griffith毕业证书)格里菲斯大学毕业证成绩单学位证书
一比一原版(Griffith毕业证书)格里菲斯大学毕业证成绩单学位证书一比一原版(Griffith毕业证书)格里菲斯大学毕业证成绩单学位证书
一比一原版(Griffith毕业证书)格里菲斯大学毕业证成绩单学位证书c3384a92eb32
 
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...Amil baba
 
Circuit Breakers for Engineering Students
Circuit Breakers for Engineering StudentsCircuit Breakers for Engineering Students
Circuit Breakers for Engineering Studentskannan348865
 
UNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxUNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxkalpana413121
 
SLIDESHARE PPT-DECISION MAKING METHODS.pptx
SLIDESHARE PPT-DECISION MAKING METHODS.pptxSLIDESHARE PPT-DECISION MAKING METHODS.pptx
SLIDESHARE PPT-DECISION MAKING METHODS.pptxCHAIRMAN M
 
Introduction-to- Metrology and Quality.pptx
Introduction-to- Metrology and Quality.pptxIntroduction-to- Metrology and Quality.pptx
Introduction-to- Metrology and Quality.pptxProfASKolap
 
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdfInvolute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdfJNTUA
 
Adsorption (mass transfer operations 2) ppt
Adsorption (mass transfer operations 2) pptAdsorption (mass transfer operations 2) ppt
Adsorption (mass transfer operations 2) pptjigup7320
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...josephjonse
 
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Tools
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and ToolsMaximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Tools
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Toolssoginsider
 
engineering chemistry power point presentation
engineering chemistry  power point presentationengineering chemistry  power point presentation
engineering chemistry power point presentationsj9399037128
 

Recently uploaded (20)

Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...
 
Databricks Generative AI Fundamentals .pdf
Databricks Generative AI Fundamentals  .pdfDatabricks Generative AI Fundamentals  .pdf
Databricks Generative AI Fundamentals .pdf
 
Dynamo Scripts for Task IDs and Space Naming.pptx
Dynamo Scripts for Task IDs and Space Naming.pptxDynamo Scripts for Task IDs and Space Naming.pptx
Dynamo Scripts for Task IDs and Space Naming.pptx
 
Passive Air Cooling System and Solar Water Heater.ppt
Passive Air Cooling System and Solar Water Heater.pptPassive Air Cooling System and Solar Water Heater.ppt
Passive Air Cooling System and Solar Water Heater.ppt
 
Working Principle of Echo Sounder and Doppler Effect.pdf
Working Principle of Echo Sounder and Doppler Effect.pdfWorking Principle of Echo Sounder and Doppler Effect.pdf
Working Principle of Echo Sounder and Doppler Effect.pdf
 
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
 
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdfInstruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
 
Artificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdfArtificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdf
 
Artificial Intelligence in due diligence
Artificial Intelligence in due diligenceArtificial Intelligence in due diligence
Artificial Intelligence in due diligence
 
一比一原版(Griffith毕业证书)格里菲斯大学毕业证成绩单学位证书
一比一原版(Griffith毕业证书)格里菲斯大学毕业证成绩单学位证书一比一原版(Griffith毕业证书)格里菲斯大学毕业证成绩单学位证书
一比一原版(Griffith毕业证书)格里菲斯大学毕业证成绩单学位证书
 
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
 
Circuit Breakers for Engineering Students
Circuit Breakers for Engineering StudentsCircuit Breakers for Engineering Students
Circuit Breakers for Engineering Students
 
UNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxUNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptx
 
SLIDESHARE PPT-DECISION MAKING METHODS.pptx
SLIDESHARE PPT-DECISION MAKING METHODS.pptxSLIDESHARE PPT-DECISION MAKING METHODS.pptx
SLIDESHARE PPT-DECISION MAKING METHODS.pptx
 
Introduction-to- Metrology and Quality.pptx
Introduction-to- Metrology and Quality.pptxIntroduction-to- Metrology and Quality.pptx
Introduction-to- Metrology and Quality.pptx
 
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdfInvolute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
 
Adsorption (mass transfer operations 2) ppt
Adsorption (mass transfer operations 2) pptAdsorption (mass transfer operations 2) ppt
Adsorption (mass transfer operations 2) ppt
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
 
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Tools
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and ToolsMaximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Tools
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Tools
 
engineering chemistry power point presentation
engineering chemistry  power point presentationengineering chemistry  power point presentation
engineering chemistry power point presentation
 

Deletion operation in array(ds)

  • 1. Deletion Operation in Array(DS) Prof. Neeraj Bhargava Kapil Chauhan Department of Computer Science School of Engineering & Systems Sciences MDS University, Ajmer
  • 2. Deletion Operation in Array  It is a process of deleting a particular element from an array.  If an element to be deleted ith location then all elements from the (i+1)th location we have to be shifted one step towards left.  So (i+1)th element is copied to ith location and (i+2)th to (i+1)th location and so on.
  • 3. Algorithm For Deletion Operation in Array  Deletion in the operation in which a value is deleted at a particular place in an array.
  • 4. Cont.. In the below diagram , we have deleted E element form the array and rewrite New array.
  • 5. Algorithm For Deletion In An Array  Algorithm: In this algorithm a value is being deleted from ith location of an array Reg[N].  Let us assume that last element in the array is at Mth position. Steps 1. Back=i 2. While (Back<M) repeat 3 and 4 3. Reg[Back]= Reg[Back+1] 4. Back= Back+1 5. M=M-1 6. End
  • 7. Explaination  Steps 1. Back=i => Back=5 2. While(Back<M) repeat step 3 to 4 => 5<8 true 3. Reg[Back]=Reg[Back+1] Reg[5]=>Reg[6]=> reg[5]=20 4. Back=Back+1 Now Back =6 again step 3. Reg[6]=Reg[6=1] = 28 step 4: Back=Back+1 =>7 again step 3 until Back<M 5. M=M-1 =8-1=>7 6. End.
  • 8. Assignment  Explain insertion of element of specific position in array. Discuss all the steps of algorithm with an example.