SlideShare uma empresa Scribd logo
1 de 15
DONE BY:
D.STEFFY
CSE B
B.S ABDUR RAHMAN UNIVERSITY
VANDALUR.
1. ALGORITHM
2.INSERTION PROCESS
3.PSUEDO CODE
1. The list is divided in to two parts
which is sorted and unsorted.
2. In each phase, the first element of
unsorted part is picked up,transferred
to sorted list and inserted at the
appropriate place.
3. A list of n elements will take atmost
n-1 passes to sort the data.
36 12 30 23 10
Let us consider the list which is given below:
The above list is divided in to two parts which
is sorted and unsorted.
36 12 30 23 10
Here, the first element is sorted. That is,36 is in
the sorted list, whereas other elements are in the
unsorted list. Next, we have to select the first
element from the unsorted list and inserted at the
appropriate place in the sorted list.
36 12 30 23 10
Now, we have selected the first
element from the unsorted list.
Then, we have to insert in to the
sorted list.
36 12 30 23 10
We have inserted the element in the
appropriate place. Now the sorted
list consists of two elements which is
12,36.
12 36 30 23 10
Again, we have to select the first element from
the unsorted list and insert at the appropriate
place.
PASS 1
12 36 30 23 10
Now ,the sorted list has three elements in it.
Again, select first element from the unsorted list
and insert at the appropriate place.
PASS 2
12 30 36 23 10
We have inserted at the correct position. Now
the sorted list has four elements in it, whereas
the unsorted list has one element. Select ,the
element from the unsorted list and insert at the
appropriate place.
PASS 3
12 23 30 36 10
Now, we have inserted the element at the
correct position. Thus the list rearranged in to
sorted one.
PASS 4
10 12 23 30 36
The sorted list is given below:
Void insertion(item a[], int n)
{
for(int i=1;i<n ; i++)
[
tmp=a[i];
for(int j=I;j<0&&tmp<a[j-1];j++)
a[j]=a[j-1];
a[j]=tmp;
}
}
THANK YOU

Mais conteúdo relacionado

Destaque

Complexo Cultural Artilha
Complexo Cultural ArtilhaComplexo Cultural Artilha
Complexo Cultural ArtilhaCaroline Farias
 
μανθούλα χλέπα 1053497_ευπραξία_καρτέρη_μετεγγραφή
μανθούλα χλέπα 1053497_ευπραξία_καρτέρη_μετεγγραφήμανθούλα χλέπα 1053497_ευπραξία_καρτέρη_μετεγγραφή
μανθούλα χλέπα 1053497_ευπραξία_καρτέρη_μετεγγραφήephikarte
 
Omnia Programació 2c09
Omnia Programació 2c09Omnia Programació 2c09
Omnia Programació 2c09Òmnia Blanes
 
DC MOJO Candidate POE
DC MOJO Candidate POEDC MOJO Candidate POE
DC MOJO Candidate POEMilitary MOJO
 
Modelling wind flow in forested areas
Modelling wind flow in forested areas Modelling wind flow in forested areas
Modelling wind flow in forested areas Jean-Claude Meteodyn
 
20161006內政部、經濟部:「105年度颱風因應作為檢討」報告
20161006內政部、經濟部:「105年度颱風因應作為檢討」報告20161006內政部、經濟部:「105年度颱風因應作為檢討」報告
20161006內政部、經濟部:「105年度颱風因應作為檢討」報告R.O.C.Executive Yuan
 
kararname ek
kararname ekkararname ek
kararname ekalieroglu
 
20161006勞動部:「參與2016社會企業世界論壇(SEWF)成果」報告
20161006勞動部:「參與2016社會企業世界論壇(SEWF)成果」報告20161006勞動部:「參與2016社會企業世界論壇(SEWF)成果」報告
20161006勞動部:「參與2016社會企業世界論壇(SEWF)成果」報告R.O.C.Executive Yuan
 
HP Client Virtualization Services
HP Client Virtualization ServicesHP Client Virtualization Services
HP Client Virtualization Servicesgadi_fe
 
Hướng dẫn sử dụng trigger trong powerpoint
Hướng dẫn sử dụng trigger trong powerpointHướng dẫn sử dụng trigger trong powerpoint
Hướng dẫn sử dụng trigger trong powerpointmrtomlearning
 
Prokaryote genome
Prokaryote genomeProkaryote genome
Prokaryote genomemonanarayan
 

Destaque (19)

Don Quixote
Don QuixoteDon Quixote
Don Quixote
 
MY_CV[1]
MY_CV[1]MY_CV[1]
MY_CV[1]
 
Complexo Cultural Artilha
Complexo Cultural ArtilhaComplexo Cultural Artilha
Complexo Cultural Artilha
 
μανθούλα χλέπα 1053497_ευπραξία_καρτέρη_μετεγγραφή
μανθούλα χλέπα 1053497_ευπραξία_καρτέρη_μετεγγραφήμανθούλα χλέπα 1053497_ευπραξία_καρτέρη_μετεγγραφή
μανθούλα χλέπα 1053497_ευπραξία_καρτέρη_μετεγγραφή
 
Omnia Programació 2c09
Omnia Programació 2c09Omnia Programació 2c09
Omnia Programació 2c09
 
9
99
9
 
DC MOJO Candidate POE
DC MOJO Candidate POEDC MOJO Candidate POE
DC MOJO Candidate POE
 
Modelling wind flow in forested areas
Modelling wind flow in forested areas Modelling wind flow in forested areas
Modelling wind flow in forested areas
 
20161006內政部、經濟部:「105年度颱風因應作為檢討」報告
20161006內政部、經濟部:「105年度颱風因應作為檢討」報告20161006內政部、經濟部:「105年度颱風因應作為檢討」報告
20161006內政部、經濟部:「105年度颱風因應作為檢討」報告
 
Doc1
Doc1Doc1
Doc1
 
Facking Day
Facking DayFacking Day
Facking Day
 
kararname ek
kararname ekkararname ek
kararname ek
 
Toward Reverse Engineering of VBA Based Excel Spreadsheets Applications
Toward Reverse Engineering of VBA Based Excel Spreadsheets ApplicationsToward Reverse Engineering of VBA Based Excel Spreadsheets Applications
Toward Reverse Engineering of VBA Based Excel Spreadsheets Applications
 
1
11
1
 
20161006勞動部:「參與2016社會企業世界論壇(SEWF)成果」報告
20161006勞動部:「參與2016社會企業世界論壇(SEWF)成果」報告20161006勞動部:「參與2016社會企業世界論壇(SEWF)成果」報告
20161006勞動部:「參與2016社會企業世界論壇(SEWF)成果」報告
 
HP Client Virtualization Services
HP Client Virtualization ServicesHP Client Virtualization Services
HP Client Virtualization Services
 
新南向政策推動計畫(0905)
新南向政策推動計畫(0905)新南向政策推動計畫(0905)
新南向政策推動計畫(0905)
 
Hướng dẫn sử dụng trigger trong powerpoint
Hướng dẫn sử dụng trigger trong powerpointHướng dẫn sử dụng trigger trong powerpoint
Hướng dẫn sử dụng trigger trong powerpoint
 
Prokaryote genome
Prokaryote genomeProkaryote genome
Prokaryote genome
 

Semelhante a Steffy

Selection sort
Selection sortSelection sort
Selection sortstella D
 
Data structure.pptx
Data structure.pptxData structure.pptx
Data structure.pptxSajalFayyaz
 
Sorting and Its Types
Sorting and Its TypesSorting and Its Types
Sorting and Its Typesamberkhan59
 
Data structure using c module 3
Data structure using c module 3Data structure using c module 3
Data structure using c module 3smruti sarangi
 
Lecture12,13,14.pdf
Lecture12,13,14.pdfLecture12,13,14.pdf
Lecture12,13,14.pdfzainab278016
 
Unit III Version I.pptx
Unit III Version I.pptxUnit III Version I.pptx
Unit III Version I.pptxssuserd602fd
 
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.docxAmuthachenthiruK
 
MODULE 5-Searching and-sorting
MODULE 5-Searching and-sortingMODULE 5-Searching and-sorting
MODULE 5-Searching and-sortingnikshaikh786
 
Bubble sort, Selection sort SORTING .pptx
Bubble sort, Selection sort SORTING .pptxBubble sort, Selection sort SORTING .pptx
Bubble sort, Selection sort SORTING .pptxKalpana Mohan
 

Semelhante a Steffy (15)

Selection sort
Selection sortSelection sort
Selection sort
 
Data structure.pptx
Data structure.pptxData structure.pptx
Data structure.pptx
 
Sorting and Its Types
Sorting and Its TypesSorting and Its Types
Sorting and Its Types
 
Data structure using c module 3
Data structure using c module 3Data structure using c module 3
Data structure using c module 3
 
Lecture12,13,14.pdf
Lecture12,13,14.pdfLecture12,13,14.pdf
Lecture12,13,14.pdf
 
Searching
SearchingSearching
Searching
 
Unit III Version I.pptx
Unit III Version I.pptxUnit III Version I.pptx
Unit III Version I.pptx
 
Queues.ppt
Queues.pptQueues.ppt
Queues.ppt
 
Sorting
SortingSorting
Sorting
 
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
 
MODULE 5-Searching and-sorting
MODULE 5-Searching and-sortingMODULE 5-Searching and-sorting
MODULE 5-Searching and-sorting
 
Queue
QueueQueue
Queue
 
search_sort.ppt
search_sort.pptsearch_sort.ppt
search_sort.ppt
 
Bubble sort, Selection sort SORTING .pptx
Bubble sort, Selection sort SORTING .pptxBubble sort, Selection sort SORTING .pptx
Bubble sort, Selection sort SORTING .pptx
 
Sorting
SortingSorting
Sorting
 

Último

notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptNANDHAKUMARA10
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086anil_gaur
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaOmar Fathy
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 

Último (20)

(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 

Steffy

  • 1.
  • 2. DONE BY: D.STEFFY CSE B B.S ABDUR RAHMAN UNIVERSITY VANDALUR.
  • 4. 1. The list is divided in to two parts which is sorted and unsorted. 2. In each phase, the first element of unsorted part is picked up,transferred to sorted list and inserted at the appropriate place. 3. A list of n elements will take atmost n-1 passes to sort the data.
  • 5. 36 12 30 23 10 Let us consider the list which is given below: The above list is divided in to two parts which is sorted and unsorted.
  • 6. 36 12 30 23 10 Here, the first element is sorted. That is,36 is in the sorted list, whereas other elements are in the unsorted list. Next, we have to select the first element from the unsorted list and inserted at the appropriate place in the sorted list.
  • 7. 36 12 30 23 10 Now, we have selected the first element from the unsorted list. Then, we have to insert in to the sorted list.
  • 8. 36 12 30 23 10 We have inserted the element in the appropriate place. Now the sorted list consists of two elements which is 12,36.
  • 9. 12 36 30 23 10 Again, we have to select the first element from the unsorted list and insert at the appropriate place. PASS 1
  • 10. 12 36 30 23 10 Now ,the sorted list has three elements in it. Again, select first element from the unsorted list and insert at the appropriate place. PASS 2
  • 11. 12 30 36 23 10 We have inserted at the correct position. Now the sorted list has four elements in it, whereas the unsorted list has one element. Select ,the element from the unsorted list and insert at the appropriate place. PASS 3
  • 12. 12 23 30 36 10 Now, we have inserted the element at the correct position. Thus the list rearranged in to sorted one. PASS 4
  • 13. 10 12 23 30 36 The sorted list is given below:
  • 14. Void insertion(item a[], int n) { for(int i=1;i<n ; i++) [ tmp=a[i]; for(int j=I;j<0&&tmp<a[j-1];j++) a[j]=a[j-1]; a[j]=tmp; } }