SlideShare a Scribd company logo
1 of 20
SEARCHING
AND
SORTING
SEARCHING
Searching is a method of finding
a element position from group of
elements in data structure, such as
array, linked list, tree or graph.
LINEAR SEARCH :
 Linear search is also called as sequential search.
 It is a basic and simple search algorithm.
 Linear search starts at the beginning of the list and
checks every element in the list.
 Linear search compares the element with all the other
elements given in the list. If the element is matched it
returns the valve index, else it returns -1.
HOW LINEAR SEARCH WORKS ?
Now, let's see the working of the linear search Algorithm.
let's take an unsorted array. It will be easy to understand the working of
linear search with an example.
Let the elements of array are -
Let the element to be searched is K = 41
Now, start from the first element and compare K with each element of the array.
The value of K, i.e., 41, is not matched with the first element of the
array. So, move to the next element. And follow the same process until
the respective element is found.
Now, the element to be searched is found. So algorithm will return
the index of the element matched.
BINARY SEARCH :
 Binary search is used for searching an element
in a sorted array.
 It is useful when there are large number of
element in an array.
 These searching technique looks for a
particular element by comparing the middle
most element of the collection.
How does Binary search work ?
Now, let’s see the working of the Binary search algorithm.
Let the elements of array are-
Let the element to be searched is, K=56
Now, the element to search is found. So algorithm will return
the index of the element matched.
SORTING :
Sorting is a method of
elements of array in a particular
format either ascending or
descending.
Insertion
sort
Selection
sort
Bubble
sort
Sorting
INSERTION SORTING :
 Insertion sort algorithm arranges a list of
elements.
 In Insertion sort algorithm every iteration
moves an element from unsorted to sorted
portion.
 Until all the elements are sorted in the list.
 This algorithm is not suitable for the large data
set.
How does Insertion sort work ?
SELECTION SORTING :
 In Selection sorting algorithm the first element
in the list is selected and it is compared with all
the remaining elements in the list.
 If any element is smaller than the selected
element then the both are swapped.
 So, the first position is filled with smallest
element.
 This procedure is repeated until the entire list
is sorted.
How does Selection sort work ?
Now, let's see the working of the Selection sort Algorithm.
To understand the working of the Selection sort algorithm, let's take an unsorted array.
Let the elements of array are –
Now, the array is completely sorted.
BUBBLE SORTING :
 Bubble sort is the simplest sorting algorithm . It
always arrange the data in descending order.
 Bubble sort algorithm is not suitable for the
huge data set.
 Bubble sort algorithm compares two items at a
time and swapping them if they are in the
wrong order.
 The iteration is repeated until no swaps are
needed, which means list is sorted.
How does Bubble sort work ?
Now, let’s see the working of the Bubble sort
Algorithm. Suppose we have a list of array of 5 elements
A[5]={40,50,30,20,10}
Iteration-I:
A[0]=40 40 40 40 40 40
A[1]=50 50 50 30 30 30
A[2]=30 30 30 50 20 20
A[3]=20 20 20 20 50 10
A[4]=10 10 10 10 10 50
Iteration-II:
40 30 30 30
30 40 20 20
20 20 40 10
10 10 10 40
50 50 50 50
Iteration-III:
30 20 20
20 30 10
10 10 30
40 40 40
50 50 50
Iteration-IV:
20 10 10
10 20 20
30 30 30
40 40 40
50 50 50
Presented by:
Ch.Sreeja
Ch.Sandeep
K.Bhavani
S.Anil
R.Mounika

More Related Content

What's hot

Searching techniques in Data Structure And Algorithm
Searching techniques in Data Structure And AlgorithmSearching techniques in Data Structure And Algorithm
Searching techniques in Data Structure And Algorithm03446940736
 
SEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMSSEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMSGokul Hari
 
Algorithms Lecture 4: Sorting Algorithms I
Algorithms Lecture 4: Sorting Algorithms IAlgorithms Lecture 4: Sorting Algorithms I
Algorithms Lecture 4: Sorting Algorithms IMohamed Loey
 
Sorting Techniques
Sorting TechniquesSorting Techniques
Sorting TechniquesRafay Farooq
 
PPT On Sorting And Searching Concepts In Data Structure | In Programming Lang...
PPT On Sorting And Searching Concepts In Data Structure | In Programming Lang...PPT On Sorting And Searching Concepts In Data Structure | In Programming Lang...
PPT On Sorting And Searching Concepts In Data Structure | In Programming Lang...Umesh Kumar
 
Bubble sort
Bubble sortBubble sort
Bubble sortManek Ar
 
linked list in data structure
linked list in data structure linked list in data structure
linked list in data structure shameen khan
 
linked list in Data Structure, Simple and Easy Tutorial
linked list in Data Structure, Simple and Easy Tutoriallinked list in Data Structure, Simple and Easy Tutorial
linked list in Data Structure, Simple and Easy TutorialAfzal Badshah
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Treesagar yadav
 
Sorting Algorithms
Sorting AlgorithmsSorting Algorithms
Sorting AlgorithmsPranay Neema
 

What's hot (20)

Searching techniques in Data Structure And Algorithm
Searching techniques in Data Structure And AlgorithmSearching techniques in Data Structure And Algorithm
Searching techniques in Data Structure And Algorithm
 
SEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMSSEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMS
 
Insertion Sorting
Insertion SortingInsertion Sorting
Insertion Sorting
 
Algorithms Lecture 4: Sorting Algorithms I
Algorithms Lecture 4: Sorting Algorithms IAlgorithms Lecture 4: Sorting Algorithms I
Algorithms Lecture 4: Sorting Algorithms I
 
Tree in data structure
Tree in data structureTree in data structure
Tree in data structure
 
Computer Science-Data Structures :Abstract DataType (ADT)
Computer Science-Data Structures :Abstract DataType (ADT)Computer Science-Data Structures :Abstract DataType (ADT)
Computer Science-Data Structures :Abstract DataType (ADT)
 
Sorting Techniques
Sorting TechniquesSorting Techniques
Sorting Techniques
 
PPT On Sorting And Searching Concepts In Data Structure | In Programming Lang...
PPT On Sorting And Searching Concepts In Data Structure | In Programming Lang...PPT On Sorting And Searching Concepts In Data Structure | In Programming Lang...
PPT On Sorting And Searching Concepts In Data Structure | In Programming Lang...
 
Searching algorithms
Searching algorithmsSearching algorithms
Searching algorithms
 
Bubble sort
Bubble sortBubble sort
Bubble sort
 
Circular queue
Circular queueCircular queue
Circular queue
 
stack presentation
stack presentationstack presentation
stack presentation
 
linked list in data structure
linked list in data structure linked list in data structure
linked list in data structure
 
Binary search tree(bst)
Binary search tree(bst)Binary search tree(bst)
Binary search tree(bst)
 
linked list in Data Structure, Simple and Easy Tutorial
linked list in Data Structure, Simple and Easy Tutoriallinked list in Data Structure, Simple and Easy Tutorial
linked list in Data Structure, Simple and Easy Tutorial
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Tree
 
Sorting Algorithms
Sorting AlgorithmsSorting Algorithms
Sorting Algorithms
 
Searching
SearchingSearching
Searching
 
Abstract Data Types
Abstract Data TypesAbstract Data Types
Abstract Data Types
 
Sorting Algorithms
Sorting AlgorithmsSorting Algorithms
Sorting Algorithms
 

Similar to SEARCH AND SORT ALGORITHMS

MODULE 5-Searching and-sorting
MODULE 5-Searching and-sortingMODULE 5-Searching and-sorting
MODULE 5-Searching and-sortingnikshaikh786
 
Searching Sorting
Searching SortingSearching Sorting
Searching Sortingguest2cb109
 
What is a Sorting Algorithm Ishank mini project.pptx
What is a Sorting Algorithm Ishank mini project.pptxWhat is a Sorting Algorithm Ishank mini project.pptx
What is a Sorting Algorithm Ishank mini project.pptxSneakyGoblin1
 
BCA DATA STRUCTURES SEARCHING AND SORTING MRS.SOWMYA JYOTHI
BCA DATA STRUCTURES SEARCHING AND SORTING MRS.SOWMYA JYOTHIBCA DATA STRUCTURES SEARCHING AND SORTING MRS.SOWMYA JYOTHI
BCA DATA STRUCTURES SEARCHING AND SORTING MRS.SOWMYA JYOTHISowmya Jyothi
 
DS - Unit 2 FINAL (2).pptx
DS - Unit 2 FINAL (2).pptxDS - Unit 2 FINAL (2).pptx
DS - Unit 2 FINAL (2).pptxprakashvs7
 
Data Structures_ Sorting & Searching
Data Structures_ Sorting & SearchingData Structures_ Sorting & Searching
Data Structures_ Sorting & SearchingThenmozhiK5
 
Searching,sorting
Searching,sortingSearching,sorting
Searching,sortingLavanyaJ28
 
advanced searching and sorting.pdf
advanced searching and sorting.pdfadvanced searching and sorting.pdf
advanced searching and sorting.pdfharamaya university
 
Sorting method data structure
Sorting method data structureSorting method data structure
Sorting method data structuresunilchute1
 
Sorting types and Algorithms
Sorting types and AlgorithmsSorting types and Algorithms
Sorting types and AlgorithmsAli Khan
 
Selection Sort and Insertion Sort
Selection Sort and Insertion SortSelection Sort and Insertion Sort
Selection Sort and Insertion Sorttamayaoraquel
 
Selection sort and insertion sort
Selection sort and insertion sortSelection sort and insertion sort
Selection sort and insertion sortMay Ann Mendoza
 
4.1 sequentioal search
4.1 sequentioal search4.1 sequentioal search
4.1 sequentioal searchKrish_ver2
 
366 it elective 4 (analysis of algoritm)
366 it elective 4 (analysis of algoritm)366 it elective 4 (analysis of algoritm)
366 it elective 4 (analysis of algoritm)Neil Soliven
 

Similar to SEARCH AND SORT ALGORITHMS (20)

Unit v data structure-converted
Unit  v data structure-convertedUnit  v data structure-converted
Unit v data structure-converted
 
MODULE 5-Searching and-sorting
MODULE 5-Searching and-sortingMODULE 5-Searching and-sorting
MODULE 5-Searching and-sorting
 
Searching Sorting
Searching SortingSearching Sorting
Searching Sorting
 
What is a Sorting Algorithm Ishank mini project.pptx
What is a Sorting Algorithm Ishank mini project.pptxWhat is a Sorting Algorithm Ishank mini project.pptx
What is a Sorting Algorithm Ishank mini project.pptx
 
BCA DATA STRUCTURES SEARCHING AND SORTING MRS.SOWMYA JYOTHI
BCA DATA STRUCTURES SEARCHING AND SORTING MRS.SOWMYA JYOTHIBCA DATA STRUCTURES SEARCHING AND SORTING MRS.SOWMYA JYOTHI
BCA DATA STRUCTURES SEARCHING AND SORTING MRS.SOWMYA JYOTHI
 
DS - Unit 2 FINAL (2).pptx
DS - Unit 2 FINAL (2).pptxDS - Unit 2 FINAL (2).pptx
DS - Unit 2 FINAL (2).pptx
 
Data Structures_ Sorting & Searching
Data Structures_ Sorting & SearchingData Structures_ Sorting & Searching
Data Structures_ Sorting & Searching
 
Searching,sorting
Searching,sortingSearching,sorting
Searching,sorting
 
advanced searching and sorting.pdf
advanced searching and sorting.pdfadvanced searching and sorting.pdf
advanced searching and sorting.pdf
 
Ch05 Black Jack
Ch05  Black  JackCh05  Black  Jack
Ch05 Black Jack
 
Sorting method data structure
Sorting method data structureSorting method data structure
Sorting method data structure
 
Sorting types and Algorithms
Sorting types and AlgorithmsSorting types and Algorithms
Sorting types and Algorithms
 
Chap10
Chap10Chap10
Chap10
 
Selection Sort and Insertion Sort
Selection Sort and Insertion SortSelection Sort and Insertion Sort
Selection Sort and Insertion Sort
 
Selection sort and insertion sort
Selection sort and insertion sortSelection sort and insertion sort
Selection sort and insertion sort
 
searching
searchingsearching
searching
 
arrays in c
arrays in carrays in c
arrays in c
 
4.1 sequentioal search
4.1 sequentioal search4.1 sequentioal search
4.1 sequentioal search
 
1 D Arrays in C++
1 D Arrays in C++1 D Arrays in C++
1 D Arrays in C++
 
366 it elective 4 (analysis of algoritm)
366 it elective 4 (analysis of algoritm)366 it elective 4 (analysis of algoritm)
366 it elective 4 (analysis of algoritm)
 

Recently uploaded

Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 

Recently uploaded (20)

Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 

SEARCH AND SORT ALGORITHMS

  • 2. SEARCHING Searching is a method of finding a element position from group of elements in data structure, such as array, linked list, tree or graph.
  • 3.
  • 4. LINEAR SEARCH :  Linear search is also called as sequential search.  It is a basic and simple search algorithm.  Linear search starts at the beginning of the list and checks every element in the list.  Linear search compares the element with all the other elements given in the list. If the element is matched it returns the valve index, else it returns -1.
  • 5. HOW LINEAR SEARCH WORKS ? Now, let's see the working of the linear search Algorithm. let's take an unsorted array. It will be easy to understand the working of linear search with an example. Let the elements of array are - Let the element to be searched is K = 41 Now, start from the first element and compare K with each element of the array. The value of K, i.e., 41, is not matched with the first element of the array. So, move to the next element. And follow the same process until the respective element is found.
  • 6. Now, the element to be searched is found. So algorithm will return the index of the element matched.
  • 7. BINARY SEARCH :  Binary search is used for searching an element in a sorted array.  It is useful when there are large number of element in an array.  These searching technique looks for a particular element by comparing the middle most element of the collection.
  • 8. How does Binary search work ? Now, let’s see the working of the Binary search algorithm. Let the elements of array are- Let the element to be searched is, K=56
  • 9. Now, the element to search is found. So algorithm will return the index of the element matched.
  • 10. SORTING : Sorting is a method of elements of array in a particular format either ascending or descending.
  • 12. INSERTION SORTING :  Insertion sort algorithm arranges a list of elements.  In Insertion sort algorithm every iteration moves an element from unsorted to sorted portion.  Until all the elements are sorted in the list.  This algorithm is not suitable for the large data set.
  • 13. How does Insertion sort work ?
  • 14. SELECTION SORTING :  In Selection sorting algorithm the first element in the list is selected and it is compared with all the remaining elements in the list.  If any element is smaller than the selected element then the both are swapped.  So, the first position is filled with smallest element.  This procedure is repeated until the entire list is sorted.
  • 15. How does Selection sort work ? Now, let's see the working of the Selection sort Algorithm. To understand the working of the Selection sort algorithm, let's take an unsorted array. Let the elements of array are –
  • 16. Now, the array is completely sorted.
  • 17. BUBBLE SORTING :  Bubble sort is the simplest sorting algorithm . It always arrange the data in descending order.  Bubble sort algorithm is not suitable for the huge data set.  Bubble sort algorithm compares two items at a time and swapping them if they are in the wrong order.  The iteration is repeated until no swaps are needed, which means list is sorted.
  • 18. How does Bubble sort work ? Now, let’s see the working of the Bubble sort Algorithm. Suppose we have a list of array of 5 elements A[5]={40,50,30,20,10} Iteration-I: A[0]=40 40 40 40 40 40 A[1]=50 50 50 30 30 30 A[2]=30 30 30 50 20 20 A[3]=20 20 20 20 50 10 A[4]=10 10 10 10 10 50
  • 19. Iteration-II: 40 30 30 30 30 40 20 20 20 20 40 10 10 10 10 40 50 50 50 50 Iteration-III: 30 20 20 20 30 10 10 10 30 40 40 40 50 50 50
  • 20. Iteration-IV: 20 10 10 10 20 20 30 30 30 40 40 40 50 50 50 Presented by: Ch.Sreeja Ch.Sandeep K.Bhavani S.Anil R.Mounika