SlideShare a Scribd company logo
1 of 25
UNIT 5
SEARCHING & SORTING
SEARCHING
 Searching is the process of determining whether or
not a given value exists in a data structure or a
storage media.
 linear search and binary search.
LINEAR SEARCH
 The linear (or sequential) search algorithm on an
array is:
 Sequentially scan the array, comparing each array item with the searched
value.
 If a match is found; return the index of the matched element; otherwise
return –1.
 Note: linear search can be applied to both sorted and
unsorted arrays.
FEATURES OF LINEAR SEARCH
 It is used for unsorted and unordered small list of
elements.
 It has a time complexity of O(n), which means the
time is linearly dependent on the number of
elements, which is not bad, but not that good too.
 It has a very simple implementation.
APPLICATIONS OF LINEAR SEARCH
 Used to find the desired element from the collection
of data when the dataset is small
 The searching operations is less than 100 items
BINARY SEARCH
 An algorithm to solve this task looks at the
middle of the array or array segment first
 If the value looked for is smaller than the
value in the middle of the array
 Then the second half of the array or array
segment can be ignored
 This strategy is then applied to the first half of the
array or array segment
BINARY SEARCH (CONT.,)
 If the value looked for is larger than the value in the
middle of the array or array segment
 Then the first half of the array or array segment can be
ignored
 This strategy is then applied to the second half of the array
or array segment
 If the value looked for is at the middle of the array
or array segment, then it has been found
 If the entire array (or array segment) has been
searched in this way without finding the value, then
it is not in the array
EFFICIENCY OF BINARY SEARCH
 The binary search algorithm is extremely fast
compared to an algorithm that tries all array
elements in order
 About half the array is eliminated from consideration
right at the start
 Then a quarter of the array, then an eighth of the array,
and so forth
APPLICATIONS OF BINARY SEARCH
 The binary search algorithm is used in the libraries
of Java, C++, etc
 It is used in another additional program like finding
the smallest element or largest element in the array
 It is used to implement a dictionary
SORTING METHODS
 Sorting Algorithms are methods of reorganizing a
large number of items into some specific order such
as highest to lowest, or vice-versa, or even in some
alphabetical order.
 These algorithms take an input list, processes it
(i.e, performs some operations on it) and produce
the sorted list.
 The most common example we experience every
day is sorting clothes or other items on an e-
commerce website either by lowest-price to highest,
or list by popularity, or some other order.
TYPES OF SORTING ALGORITHMS
 Shell sort
 Heap sort
 Radix sort
 Bucket sort
 Quick sort
 Bubble sort
 Merge sort
 Insertion sort
 Selection sort
BUBBLE SORT
 Bubble sort, also referred to as comparison sort
 It is a simple sorting algorithm that repeatedly goes
through the list, compares adjacent elements and
swaps them if they are in the wrong order.
 This is the most simplest algorithm and inefficient at
the same time.
 https://www.interviewbit.com/tutorial/bubble-sort/
SELECTION SORT
 Selection sort is a simple comparison-based sorting
algorithm
 Steps to be followed
 Pick the minimum element from the unsorted
subarray.
 Swap it with the leftmost element of the unsorted
subarray.
 Now the leftmost element of unsorted subarray
becomes a part (rightmost) of sorted subarray and
will not be a part of unsorted subarray.
https://www.interviewbit.com/tutorial/selection-sort/
INSERTION SORT
 Insertion sort is the sorting mechanism where the
sorted array is built having one item at a time.
 The array elements are compared with each other
sequentially and then arranged simultaneously in
some particular order.
 This sort works on the principle of inserting an
element at a particular position, hence the name
Insertion Sort.
 https://www.interviewbit.com/tutorial/insertion-sort-
algorithm/
SHELL SORT
 Shell sort is a highly efficient sorting algorithm and is
based on insertion sort algorithm.
 This algorithm avoids large shifts as in case of insertion
sort, if the smaller value is to the far right and has to be
moved to the far left.
 Steps to be followed
 Step 1 − Initialize the value of h.
 Step 2 − Divide the list into smaller sub-list of equal
interval h.
 Step 3 − Sort these sub-lists using insertion sort.
 Step 3 − Repeat until complete list is sorted.
 https://www.tutorialspoint.com/data_structures_algorith
ms/shell_sort_algorithm.htm
RADIX SORT
 Radix sort is one of the sorting algorithms used
to sort a list of integer numbers in order.
 In radix sort algorithm, a list of integer numbers will
be sorted based on the digits of individual numbers.
 Sorting is performed from least significant digit to
the most significant digit.
QUICK SORT
 It is one of the most efficient sorting algorithms and
is based on the splitting of an array (partition) into
smaller ones and swapping (exchange) based on
the comparison with 'pivot' element selected.
 Due to this, quick sort is also called as "Partition
Exchange" sort.
 Steps to be followed:
 Step 1 − Make any element as pivot
Step 2 − Partition the array on the basis of pivot
Step 3 − Apply quick sort on left partition
recursively
Step 4 − Apply quick sort on right partition
recursively
HEAP SORT
 Heap sort is a comparison-based sorting
technique based on Binary Heap data structure
 https://www.youtube.com/watch?v=MtQL_ll5KhQ
 There are two kinds of heaps: min-heap and max-
heap.
 In min-heap parents nodes are smaller than
children nodes (the root node is smallest), while in
max-heap it is opposite (the root node is largest).
MERGE SORT
 Merge sort is one of the most efficient sorting
algorithms. It works on the principle of Divide and
Conquer.
 Merge sort repeatedly breaks down a list into
several sublists until each sublist consists of a
single element and merging those sublists in a
manner that results into a sorted list.
 https://www.interviewbit.com/tutorial/merge-sort-
algorithm/
COMPARISON OF SORTING ALOGORITHMS
 In a comparison based sorting algorithms, we
compare elements of an array with each other to
determines which of two elements should occur first
in the final sorted list.
 All comparison-based sorting algorithms have a
complexity lower bound of nlogn.
Searching,sorting

More Related Content

What's hot

Indexing and-hashing
Indexing and-hashingIndexing and-hashing
Indexing and-hashing
Ami Ranjit
 
Data structure and its types
Data structure and its typesData structure and its types
Data structure and its types
Navtar Sidhu Brar
 

What's hot (20)

Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Tree
 
Indexing and-hashing
Indexing and-hashingIndexing and-hashing
Indexing and-hashing
 
Binary search
Binary searchBinary search
Binary search
 
Data structure and its types
Data structure and its typesData structure and its types
Data structure and its types
 
Sorting algorithms
Sorting algorithmsSorting algorithms
Sorting algorithms
 
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...
 
Quick sort
Quick sortQuick sort
Quick sort
 
Trees, Binary Search Tree, AVL Tree in Data Structures
Trees, Binary Search Tree, AVL Tree in Data Structures Trees, Binary Search Tree, AVL Tree in Data Structures
Trees, Binary Search Tree, AVL Tree in Data Structures
 
Bubble Sort Algorithm Presentation
Bubble Sort Algorithm Presentation Bubble Sort Algorithm Presentation
Bubble Sort Algorithm Presentation
 
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
 
Doubly linked list
Doubly linked listDoubly linked list
Doubly linked list
 
Sorting Algorithms
Sorting AlgorithmsSorting Algorithms
Sorting Algorithms
 
Data Structures - Lecture 7 [Linked List]
Data Structures - Lecture 7 [Linked List]Data Structures - Lecture 7 [Linked List]
Data Structures - Lecture 7 [Linked List]
 
Binary search tree operations
Binary search tree operationsBinary search tree operations
Binary search tree operations
 
Arrays in C++
Arrays in C++Arrays in C++
Arrays in C++
 
3 searching algorithms in Java
3 searching algorithms in Java3 searching algorithms in Java
3 searching algorithms in Java
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Tree
 
Linked list implementation of Queue
Linked list implementation of QueueLinked list implementation of Queue
Linked list implementation of Queue
 
Data structures using C
Data structures using CData structures using C
Data structures using C
 
Queues
QueuesQueues
Queues
 

Similar to Searching,sorting

DS - Unit 2 FINAL (2).pptx
DS - Unit 2 FINAL (2).pptxDS - Unit 2 FINAL (2).pptx
DS - Unit 2 FINAL (2).pptx
prakashvs7
 
Algorithm 8th lecture linear & binary search(2).pptx
Algorithm 8th lecture linear & binary search(2).pptxAlgorithm 8th lecture linear & binary search(2).pptx
Algorithm 8th lecture linear & binary search(2).pptx
Aftabali702240
 
Ijcse13 05-01-048
Ijcse13 05-01-048Ijcse13 05-01-048
Ijcse13 05-01-048
vital vital
 
Ijcse13 05-01-048
Ijcse13 05-01-048Ijcse13 05-01-048
Ijcse13 05-01-048
vital vital
 
Data Structure & Algorithms - Operations
Data Structure & Algorithms - OperationsData Structure & Algorithms - Operations
Data Structure & Algorithms - Operations
babuk110
 

Similar to Searching,sorting (20)

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
 
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
 
4.1 sequentioal search
4.1 sequentioal search4.1 sequentioal search
4.1 sequentioal search
 
SORTING techniques.pptx
SORTING techniques.pptxSORTING techniques.pptx
SORTING techniques.pptx
 
Unit v data structure-converted
Unit  v data structure-convertedUnit  v data structure-converted
Unit v data structure-converted
 
Sorting.pptx
Sorting.pptxSorting.pptx
Sorting.pptx
 
Algorithm 8th lecture linear & binary search(2).pptx
Algorithm 8th lecture linear & binary search(2).pptxAlgorithm 8th lecture linear & binary search(2).pptx
Algorithm 8th lecture linear & binary search(2).pptx
 
arrays in c
arrays in carrays in c
arrays in c
 
advanced searching and sorting.pdf
advanced searching and sorting.pdfadvanced searching and sorting.pdf
advanced searching and sorting.pdf
 
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
 
Analysis of Algorithm - Binary Search.pptx
Analysis of Algorithm - Binary Search.pptxAnalysis of Algorithm - Binary Search.pptx
Analysis of Algorithm - Binary Search.pptx
 
Sorting algorithms in Data Structure
Sorting algorithms in Data StructureSorting algorithms in Data Structure
Sorting algorithms in Data Structure
 
cs702 ppt.ppt
cs702 ppt.pptcs702 ppt.ppt
cs702 ppt.ppt
 
Sorting
SortingSorting
Sorting
 
Searching and sorting
Searching  and sortingSearching  and sorting
Searching and sorting
 
Ijcse13 05-01-048
Ijcse13 05-01-048Ijcse13 05-01-048
Ijcse13 05-01-048
 
Ijcse13 05-01-048
Ijcse13 05-01-048Ijcse13 05-01-048
Ijcse13 05-01-048
 
Data Structure & Algorithms - Operations
Data Structure & Algorithms - OperationsData Structure & Algorithms - Operations
Data Structure & Algorithms - Operations
 

More from LavanyaJ28 (16)

Cs1301 syllabus
Cs1301  syllabusCs1301  syllabus
Cs1301 syllabus
 
Ds important questions
Ds important questionsDs important questions
Ds important questions
 
2 marks- DS using python
2 marks- DS using python2 marks- DS using python
2 marks- DS using python
 
Hashing
HashingHashing
Hashing
 
Graphs
GraphsGraphs
Graphs
 
Unit 3 trees
Unit 3   treesUnit 3   trees
Unit 3 trees
 
Heap types & Trees
Heap types & TreesHeap types & Trees
Heap types & Trees
 
Unit ii linear data structures
Unit ii linear data structures Unit ii linear data structures
Unit ii linear data structures
 
Unit ii linear data structures
Unit ii linear data structures Unit ii linear data structures
Unit ii linear data structures
 
Unit 2 application of stack
Unit 2  application of stack Unit 2  application of stack
Unit 2 application of stack
 
Stack and queue
Stack and queueStack and queue
Stack and queue
 
Unit 1 linked list
Unit 1 linked listUnit 1 linked list
Unit 1 linked list
 
Unit 1 Basic concepts to DS
Unit 1 Basic concepts to DSUnit 1 Basic concepts to DS
Unit 1 Basic concepts to DS
 
Unit 1 array based implementation
Unit 1  array based implementationUnit 1  array based implementation
Unit 1 array based implementation
 
Unit 1 polynomial manipulation
Unit 1   polynomial manipulationUnit 1   polynomial manipulation
Unit 1 polynomial manipulation
 
Unit 1 abstract data types
Unit 1 abstract data typesUnit 1 abstract data types
Unit 1 abstract data types
 

Recently uploaded

Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Christo Ananth
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 

Recently uploaded (20)

Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
(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
 
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
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 
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
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 

Searching,sorting

  • 2. SEARCHING  Searching is the process of determining whether or not a given value exists in a data structure or a storage media.  linear search and binary search.
  • 3. LINEAR SEARCH  The linear (or sequential) search algorithm on an array is:  Sequentially scan the array, comparing each array item with the searched value.  If a match is found; return the index of the matched element; otherwise return –1.  Note: linear search can be applied to both sorted and unsorted arrays.
  • 4. FEATURES OF LINEAR SEARCH  It is used for unsorted and unordered small list of elements.  It has a time complexity of O(n), which means the time is linearly dependent on the number of elements, which is not bad, but not that good too.  It has a very simple implementation.
  • 5.
  • 6. APPLICATIONS OF LINEAR SEARCH  Used to find the desired element from the collection of data when the dataset is small  The searching operations is less than 100 items
  • 7. BINARY SEARCH  An algorithm to solve this task looks at the middle of the array or array segment first  If the value looked for is smaller than the value in the middle of the array  Then the second half of the array or array segment can be ignored  This strategy is then applied to the first half of the array or array segment
  • 8. BINARY SEARCH (CONT.,)  If the value looked for is larger than the value in the middle of the array or array segment  Then the first half of the array or array segment can be ignored  This strategy is then applied to the second half of the array or array segment  If the value looked for is at the middle of the array or array segment, then it has been found  If the entire array (or array segment) has been searched in this way without finding the value, then it is not in the array
  • 9. EFFICIENCY OF BINARY SEARCH  The binary search algorithm is extremely fast compared to an algorithm that tries all array elements in order  About half the array is eliminated from consideration right at the start  Then a quarter of the array, then an eighth of the array, and so forth
  • 10.
  • 11. APPLICATIONS OF BINARY SEARCH  The binary search algorithm is used in the libraries of Java, C++, etc  It is used in another additional program like finding the smallest element or largest element in the array  It is used to implement a dictionary
  • 12. SORTING METHODS  Sorting Algorithms are methods of reorganizing a large number of items into some specific order such as highest to lowest, or vice-versa, or even in some alphabetical order.  These algorithms take an input list, processes it (i.e, performs some operations on it) and produce the sorted list.  The most common example we experience every day is sorting clothes or other items on an e- commerce website either by lowest-price to highest, or list by popularity, or some other order.
  • 13. TYPES OF SORTING ALGORITHMS  Shell sort  Heap sort  Radix sort  Bucket sort  Quick sort  Bubble sort  Merge sort  Insertion sort  Selection sort
  • 14. BUBBLE SORT  Bubble sort, also referred to as comparison sort  It is a simple sorting algorithm that repeatedly goes through the list, compares adjacent elements and swaps them if they are in the wrong order.  This is the most simplest algorithm and inefficient at the same time.  https://www.interviewbit.com/tutorial/bubble-sort/
  • 15. SELECTION SORT  Selection sort is a simple comparison-based sorting algorithm  Steps to be followed  Pick the minimum element from the unsorted subarray.  Swap it with the leftmost element of the unsorted subarray.  Now the leftmost element of unsorted subarray becomes a part (rightmost) of sorted subarray and will not be a part of unsorted subarray. https://www.interviewbit.com/tutorial/selection-sort/
  • 16. INSERTION SORT  Insertion sort is the sorting mechanism where the sorted array is built having one item at a time.  The array elements are compared with each other sequentially and then arranged simultaneously in some particular order.  This sort works on the principle of inserting an element at a particular position, hence the name Insertion Sort.  https://www.interviewbit.com/tutorial/insertion-sort- algorithm/
  • 17. SHELL SORT  Shell sort is a highly efficient sorting algorithm and is based on insertion sort algorithm.  This algorithm avoids large shifts as in case of insertion sort, if the smaller value is to the far right and has to be moved to the far left.  Steps to be followed  Step 1 − Initialize the value of h.  Step 2 − Divide the list into smaller sub-list of equal interval h.  Step 3 − Sort these sub-lists using insertion sort.  Step 3 − Repeat until complete list is sorted.  https://www.tutorialspoint.com/data_structures_algorith ms/shell_sort_algorithm.htm
  • 18. RADIX SORT  Radix sort is one of the sorting algorithms used to sort a list of integer numbers in order.  In radix sort algorithm, a list of integer numbers will be sorted based on the digits of individual numbers.  Sorting is performed from least significant digit to the most significant digit.
  • 19.
  • 20. QUICK SORT  It is one of the most efficient sorting algorithms and is based on the splitting of an array (partition) into smaller ones and swapping (exchange) based on the comparison with 'pivot' element selected.  Due to this, quick sort is also called as "Partition Exchange" sort.  Steps to be followed:  Step 1 − Make any element as pivot Step 2 − Partition the array on the basis of pivot Step 3 − Apply quick sort on left partition recursively Step 4 − Apply quick sort on right partition recursively
  • 21.
  • 22. HEAP SORT  Heap sort is a comparison-based sorting technique based on Binary Heap data structure  https://www.youtube.com/watch?v=MtQL_ll5KhQ  There are two kinds of heaps: min-heap and max- heap.  In min-heap parents nodes are smaller than children nodes (the root node is smallest), while in max-heap it is opposite (the root node is largest).
  • 23. MERGE SORT  Merge sort is one of the most efficient sorting algorithms. It works on the principle of Divide and Conquer.  Merge sort repeatedly breaks down a list into several sublists until each sublist consists of a single element and merging those sublists in a manner that results into a sorted list.  https://www.interviewbit.com/tutorial/merge-sort- algorithm/
  • 24. COMPARISON OF SORTING ALOGORITHMS  In a comparison based sorting algorithms, we compare elements of an array with each other to determines which of two elements should occur first in the final sorted list.  All comparison-based sorting algorithms have a complexity lower bound of nlogn.