SlideShare a Scribd company logo
PPT On Sorting And Searching Concepts In Data Structure | In Programming Language |
An algorithm is a finite collection of well defined steps
to solve
A particular problem. An algorithm Is a finite sequence
of instructions,
Logic, step by step process for solving a problem.
PPT On Sorting And Searching Concepts In Data Structure | In Programming Language |
PPT On Sorting And Searching Concepts In Data Structure | In Programming Language |
Sorting technique to arranging data in a
particular format. Sorting algorithm specifies
the
Way to arrange data in a particular order. Most
common are numerical or lexicograpical order.
Sorting is also used to represent data in more
readable formats.
Telephone Directory – Telephone directory keeps
telephone No. of people sorted on their
Names. So that names can be searched.
Dictionary – Dictionary keeps words in
alphabetical order so that searching of any work
becomes easy.
Bubble Sort is a simple sorting algorithm. This
sorting algorithm is comparison
Based algorithm in which each pair of
adjacent elements is compared & elements
Are swapped if they are not in order. This
algorithm is not suitable for large data
Sets as its average and worst case complexity.
We take an unsorted array for our example:
14 33 27 35 10
14
14
14
14
14
14
14
14
1433
33
33
27 33
27
27
27
35
35
35
35
10
10
10
10
27
27
27
27
27
33
33
33
33
10
35
35
35
10
35
10
10
10
35
33
14
14
10
10
27
27 33
33
35
35
This is a in-place comparison based sorting
algorithm. Here, a sub-list is always sorted.
For example, the lower part of an array is
maintained to be sorted. The array is
searched
Sequentially and unsorted items are moved
and inserted into sorted sub-list.
14 33 27 3510
14
14
14
14
14
14
14
14
1433
33
33
33 27
27
27
27
10
10
10
10
35
35
35
35
27
27
27
27
27
33
33
33
10
10
10
10
10
33
35
35
35
35
35
33
We take an unsorted array for our example.
14
14
14
10
10
10
27
27
27
33
33
33
35
35
35
Selection sort is a simple sorting algorithm .
This sorting algorithm is a in-place
Comparison based algorithm in which the
list is divided into two parts, sorted
Part at left end and unsorted part at right
end. intially end sorted part is empty
And unsorted part is entire list.
We take the depicted array for our example :
14 33 27 10 35
14
10
10
10
10
10
10
10
1033
33
33
33 27
27
27
27
10
14
14
14
35
35
35
35
14
14
14
14
14
27
27
27
19
19
33
33
33
33
35
35
35
35
35
33
19 19
19
19
27
27
19
19
19
19
10
10
10
10
10
14
14
14
14
14
19
19
19
19
19
27
27
27
27
33
35
35
35
33
27
33
33
33
35
35
Merge Sort is a sorting technique based
on divide & conquer technique. With
worst case time complexity being
respected algorithms. Merge Sort first
divides the array into equal halves &
Then combines them in a sorted manner.
To understand merge sort, we take an unsorted array as depicted below.
14 33 27 10 35 19 42 44
35 19 42 4414 33 27 10
14 33 27 10 35 19 42 44
14 33 27 10 35 19 42 44
14 33 10 27 19 35 42 44
Combine Them into another list
10 14 33 27 19 35 42 44
After final merging, the list should look like this :
10 14 19 27 33 35 42 44
Quick sort is a highly efficient sorting
algorithm and is based on partitioning of array
Of data into smaller arrays. The quick sort
partitions an array and then calls itself
recursively twice to sort the resulting two sub
arrays. This algorithm is quite efficient for
large size data sets its average & worst case
complexity are of 0.
The below given image representation explains how to find
pivot value in the way.
10 42 35 33 31 27 26 19 14 44
10 14 19 26 27 31 33 35 42 44
PPT On Sorting And Searching Concepts In Data Structure | In Programming Language |
Linear search is a very simple search algorithm. In
this type search, a sequential
search is made over all items one by one. Every
items is checked & if a match founds them
Particular item is returned otherwise search
continues till the end of the data collection.
Suppose that we find 33 in array element
Linear Search
10 14 19 26 27 31 33 35 42 44
=
33
10 14 19 26 27 31 33 35 42 44
Binary search is a fast search algorithm
with run-time complexity of 0 (log n) .
This search algorithm works on the
principle of divide & compare. For this
algorithm to work properly the data
collection should be in sorted form.
The below given is our sorted array and assume that we need to search location
Of value 31 using binary search.
10 14 19 26 27 31 33 35 42 44
0 1 2 3 4 5 6 7 8 9
First, we shall determine the half of the array by using this formula-
Mid = low + (high – low) / 2
Here it is, 0+(9-0) / 2 = 4(integer value of 4.5). So 4 is the mid of array.
10 14 19 26 27 31 33 35 42 44
0 1 2 3 4 5 6 7 8 9
We change our low to mid + 1 and final the new value again.
Low = mid + 1
Mid = low + (high – low) / 2
Our new mid 7 now. We compare the value stored at location 7 with our target value 31.
10 14 19 26 27 31 33 35 42 44
0 1 2 3 4 5 6 7 8 9
The value stored at location 7 is not match, rather it is less that what we are looking for.
So the value must be in lower part from this location.
10 14 19 26 27 31 33 35 42 44
0 1 2 3 4 5 6 7 8 9
So we calculate the mid again. This time is 5.
10 14 19 26 27 31 33 35 42 44
0 1 2 3 4 5 6 7 8 9
We compare the value stored ad location 5 with our target value. We find
that is a match.
10 14 19 26 27 31 33 35 42 44
0 1 2 3 4 5 6 7 8 9
We conclude that the target value 31 is stored at location 5.
PPT On Sorting And Searching Concepts In Data Structure | In Programming Language |
End Of The Moment
Ad

Recommended

Merge sort and quick sort
Merge sort and quick sort
Shakila Mahjabin
 
Sorting Algorithms
Sorting Algorithms
Mohammed Hussein
 
Bubble sort, Selection sort SORTING .pptx
Bubble sort, Selection sort SORTING .pptx
Kalpana Mohan
 
Sorting algorithms
Sorting algorithms
CHANDAN KUMAR
 
Bucket sort
Bucket sort
Hossain Md Shakhawat
 
Quick sort
Quick sort
Jehat Hassan
 
Quick sort
Quick sort
amar kakde
 
Shell sorting
Shell sorting
TUC
 
Insertion sort
Insertion sort
almaqboli
 
SEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMS
Gokul Hari
 
Binary Search
Binary Search
kunj desai
 
Chapter 11 - Sorting and Searching
Chapter 11 - Sorting and Searching
Eduardo Bergavera
 
Quick Sort
Quick Sort
Shweta Sahu
 
Topological Sorting
Topological Sorting
ShahDhruv21
 
Binary search
Binary search
AparnaKumari31
 
Insertion sort
Insertion sort
Monalisa Patel
 
Searching and Sorting Techniques in Data Structure
Searching and Sorting Techniques in Data Structure
Balwant Gorad
 
Binary Search - Design & Analysis of Algorithms
Binary Search - Design & Analysis of Algorithms
Drishti Bhalla
 
Linear search-and-binary-search
Linear search-and-binary-search
International Islamic University
 
Searching
Searching
Ashim Lamichhane
 
linear search and binary search
linear search and binary search
Zia Ush Shamszaman
 
Queues
Queues
Ashim Lamichhane
 
Stacks IN DATA STRUCTURES
Stacks IN DATA STRUCTURES
Sowmya Jyothi
 
single linked list
single linked list
Sathasivam Rangasamy
 
Array data structure
Array data structure
maamir farooq
 
Searching techniques in Data Structure And Algorithm
Searching techniques in Data Structure And Algorithm
03446940736
 
sorting and its types
sorting and its types
SIVASHANKARIRAJAN
 
Circular link list.ppt
Circular link list.ppt
Tirthika Bandi
 
Algorithm & data structures lec4&5
Algorithm & data structures lec4&5
Abdul Khan
 
Searching and Sorting algorithms and working
Searching and Sorting algorithms and working
RitikaLohiya2
 

More Related Content

What's hot (20)

Insertion sort
Insertion sort
almaqboli
 
SEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMS
Gokul Hari
 
Binary Search
Binary Search
kunj desai
 
Chapter 11 - Sorting and Searching
Chapter 11 - Sorting and Searching
Eduardo Bergavera
 
Quick Sort
Quick Sort
Shweta Sahu
 
Topological Sorting
Topological Sorting
ShahDhruv21
 
Binary search
Binary search
AparnaKumari31
 
Insertion sort
Insertion sort
Monalisa Patel
 
Searching and Sorting Techniques in Data Structure
Searching and Sorting Techniques in Data Structure
Balwant Gorad
 
Binary Search - Design & Analysis of Algorithms
Binary Search - Design & Analysis of Algorithms
Drishti Bhalla
 
Linear search-and-binary-search
Linear search-and-binary-search
International Islamic University
 
Searching
Searching
Ashim Lamichhane
 
linear search and binary search
linear search and binary search
Zia Ush Shamszaman
 
Queues
Queues
Ashim Lamichhane
 
Stacks IN DATA STRUCTURES
Stacks IN DATA STRUCTURES
Sowmya Jyothi
 
single linked list
single linked list
Sathasivam Rangasamy
 
Array data structure
Array data structure
maamir farooq
 
Searching techniques in Data Structure And Algorithm
Searching techniques in Data Structure And Algorithm
03446940736
 
sorting and its types
sorting and its types
SIVASHANKARIRAJAN
 
Circular link list.ppt
Circular link list.ppt
Tirthika Bandi
 
Insertion sort
Insertion sort
almaqboli
 
SEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMS
Gokul Hari
 
Chapter 11 - Sorting and Searching
Chapter 11 - Sorting and Searching
Eduardo Bergavera
 
Topological Sorting
Topological Sorting
ShahDhruv21
 
Searching and Sorting Techniques in Data Structure
Searching and Sorting Techniques in Data Structure
Balwant Gorad
 
Binary Search - Design & Analysis of Algorithms
Binary Search - Design & Analysis of Algorithms
Drishti Bhalla
 
linear search and binary search
linear search and binary search
Zia Ush Shamszaman
 
Stacks IN DATA STRUCTURES
Stacks IN DATA STRUCTURES
Sowmya Jyothi
 
Array data structure
Array data structure
maamir farooq
 
Searching techniques in Data Structure And Algorithm
Searching techniques in Data Structure And Algorithm
03446940736
 
Circular link list.ppt
Circular link list.ppt
Tirthika Bandi
 

Similar to PPT On Sorting And Searching Concepts In Data Structure | In Programming Language | (20)

Algorithm & data structures lec4&5
Algorithm & data structures lec4&5
Abdul Khan
 
Searching and Sorting algorithms and working
Searching and Sorting algorithms and working
RitikaLohiya2
 
module2_dIVIDEncONQUER_2022.pdf
module2_dIVIDEncONQUER_2022.pdf
Shiwani Gupta
 
Module 2_ Divide and Conquer Approach.pptx
Module 2_ Divide and Conquer Approach.pptx
nikshaikh786
 
Data structure using c module 3
Data structure using c module 3
smruti sarangi
 
Data operatons & searching and sorting algorithms
Data operatons & searching and sorting algorithms
Anushdika Jeganathan
 
AJisthewewrtyuiojhghfdfsgvhjhklopi87ytrytfghjk
AJisthewewrtyuiojhghfdfsgvhjhklopi87ytrytfghjk
PradipTadme
 
2.Problem Solving Techniques and Data Structures.pptx
2.Problem Solving Techniques and Data Structures.pptx
Ganesh Bhosale
 
Weak 11-12 Sorting update.pptxbhjiiuuuuu
Weak 11-12 Sorting update.pptxbhjiiuuuuu
baloch4551701
 
Searching
Searching
Muhammad Farhan
 
Merge sort analysis and its real time applications
Merge sort analysis and its real time applications
yazad dumasia
 
sorting and searching.pptx
sorting and searching.pptx
ParagAhir1
 
All Searching and Sorting Techniques in Data Structures
All Searching and Sorting Techniques in Data Structures
sonalishinge2015
 
SORT AND SEARCH ARRAY WITH WITH C++.pptx
SORT AND SEARCH ARRAY WITH WITH C++.pptx
narifmsit18seecs
 
DIVIDE AND CONQUERMETHOD IN DATASTRUCTURE.pptx
DIVIDE AND CONQUERMETHOD IN DATASTRUCTURE.pptx
LakshmiSamivel
 
Searching Sorting-SELECTION ,BUBBBLE.ppt
Searching Sorting-SELECTION ,BUBBBLE.ppt
kunalpatil5661
 
Sorting
Sorting
invertis university
 
Sorting Algorithms to arrange data in particular format
Sorting Algorithms to arrange data in particular format
itsusamazahid
 
advanced searching and sorting.pdf
advanced searching and sorting.pdf
haramaya university
 
Bs,qs,divide and conquer 1
Bs,qs,divide and conquer 1
subhashchandra197
 
Algorithm & data structures lec4&5
Algorithm & data structures lec4&5
Abdul Khan
 
Searching and Sorting algorithms and working
Searching and Sorting algorithms and working
RitikaLohiya2
 
module2_dIVIDEncONQUER_2022.pdf
module2_dIVIDEncONQUER_2022.pdf
Shiwani Gupta
 
Module 2_ Divide and Conquer Approach.pptx
Module 2_ Divide and Conquer Approach.pptx
nikshaikh786
 
Data structure using c module 3
Data structure using c module 3
smruti sarangi
 
Data operatons & searching and sorting algorithms
Data operatons & searching and sorting algorithms
Anushdika Jeganathan
 
AJisthewewrtyuiojhghfdfsgvhjhklopi87ytrytfghjk
AJisthewewrtyuiojhghfdfsgvhjhklopi87ytrytfghjk
PradipTadme
 
2.Problem Solving Techniques and Data Structures.pptx
2.Problem Solving Techniques and Data Structures.pptx
Ganesh Bhosale
 
Weak 11-12 Sorting update.pptxbhjiiuuuuu
Weak 11-12 Sorting update.pptxbhjiiuuuuu
baloch4551701
 
Merge sort analysis and its real time applications
Merge sort analysis and its real time applications
yazad dumasia
 
sorting and searching.pptx
sorting and searching.pptx
ParagAhir1
 
All Searching and Sorting Techniques in Data Structures
All Searching and Sorting Techniques in Data Structures
sonalishinge2015
 
SORT AND SEARCH ARRAY WITH WITH C++.pptx
SORT AND SEARCH ARRAY WITH WITH C++.pptx
narifmsit18seecs
 
DIVIDE AND CONQUERMETHOD IN DATASTRUCTURE.pptx
DIVIDE AND CONQUERMETHOD IN DATASTRUCTURE.pptx
LakshmiSamivel
 
Searching Sorting-SELECTION ,BUBBBLE.ppt
Searching Sorting-SELECTION ,BUBBBLE.ppt
kunalpatil5661
 
Sorting Algorithms to arrange data in particular format
Sorting Algorithms to arrange data in particular format
itsusamazahid
 
advanced searching and sorting.pdf
advanced searching and sorting.pdf
haramaya university
 
Ad

More from Umesh Kumar (7)

Payroll System in india
Payroll System in india
Umesh Kumar
 
What Is Robotics & It's Simulation ?
What Is Robotics & It's Simulation ?
Umesh Kumar
 
PPT On INTERNET
PPT On INTERNET
Umesh Kumar
 
PPT On MS-Access 2007 | Full Concepts |
PPT On MS-Access 2007 | Full Concepts |
Umesh Kumar
 
PPT On Ports | Full Concept | Ports In Depth
PPT On Ports | Full Concept | Ports In Depth
Umesh Kumar
 
PPT On Microsoft Excel 2007 Full Information.
PPT On Microsoft Excel 2007 Full Information.
Umesh Kumar
 
PPT On Computer Generations
PPT On Computer Generations
Umesh Kumar
 
Payroll System in india
Payroll System in india
Umesh Kumar
 
What Is Robotics & It's Simulation ?
What Is Robotics & It's Simulation ?
Umesh Kumar
 
PPT On MS-Access 2007 | Full Concepts |
PPT On MS-Access 2007 | Full Concepts |
Umesh Kumar
 
PPT On Ports | Full Concept | Ports In Depth
PPT On Ports | Full Concept | Ports In Depth
Umesh Kumar
 
PPT On Microsoft Excel 2007 Full Information.
PPT On Microsoft Excel 2007 Full Information.
Umesh Kumar
 
PPT On Computer Generations
PPT On Computer Generations
Umesh Kumar
 
Ad

Recently uploaded (20)

UserCon Belgium: Honey, VMware increased my bill
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
Daily Lesson Log MATATAG ICT TEchnology 8
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
Lessons Learned from Developing Secure AI Workflows.pdf
Lessons Learned from Developing Secure AI Workflows.pdf
Priyanka Aash
 
Connecting Data and Intelligence: The Role of FME in Machine Learning
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Safe Software
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
PyCon SG 25 - Firecracker Made Easy with Python.pdf
PyCon SG 25 - Firecracker Made Easy with Python.pdf
Muhammad Yuga Nugraha
 
The Growing Value and Application of FME & GenAI
The Growing Value and Application of FME & GenAI
Safe Software
 
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
Python Conference Singapore - 19 Jun 2025
Python Conference Singapore - 19 Jun 2025
ninefyi
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Priyanka Aash
 
You are not excused! How to avoid security blind spots on the way to production
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
10 Key Challenges for AI within the EU Data Protection Framework.pdf
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Priyanka Aash
 
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
ScyllaDB
 
Securing AI - There Is No Try, Only Do!.pdf
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
UserCon Belgium: Honey, VMware increased my bill
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
Daily Lesson Log MATATAG ICT TEchnology 8
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
Lessons Learned from Developing Secure AI Workflows.pdf
Lessons Learned from Developing Secure AI Workflows.pdf
Priyanka Aash
 
Connecting Data and Intelligence: The Role of FME in Machine Learning
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Safe Software
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
PyCon SG 25 - Firecracker Made Easy with Python.pdf
PyCon SG 25 - Firecracker Made Easy with Python.pdf
Muhammad Yuga Nugraha
 
The Growing Value and Application of FME & GenAI
The Growing Value and Application of FME & GenAI
Safe Software
 
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
Python Conference Singapore - 19 Jun 2025
Python Conference Singapore - 19 Jun 2025
ninefyi
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Priyanka Aash
 
You are not excused! How to avoid security blind spots on the way to production
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
10 Key Challenges for AI within the EU Data Protection Framework.pdf
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Priyanka Aash
 
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
ScyllaDB
 
Securing AI - There Is No Try, Only Do!.pdf
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 

PPT On Sorting And Searching Concepts In Data Structure | In Programming Language |

  • 2. An algorithm is a finite collection of well defined steps to solve A particular problem. An algorithm Is a finite sequence of instructions, Logic, step by step process for solving a problem.
  • 5. Sorting technique to arranging data in a particular format. Sorting algorithm specifies the Way to arrange data in a particular order. Most common are numerical or lexicograpical order. Sorting is also used to represent data in more readable formats.
  • 6. Telephone Directory – Telephone directory keeps telephone No. of people sorted on their Names. So that names can be searched. Dictionary – Dictionary keeps words in alphabetical order so that searching of any work becomes easy.
  • 7. Bubble Sort is a simple sorting algorithm. This sorting algorithm is comparison Based algorithm in which each pair of adjacent elements is compared & elements Are swapped if they are not in order. This algorithm is not suitable for large data Sets as its average and worst case complexity.
  • 8. We take an unsorted array for our example: 14 33 27 35 10 14 14 14 14 14 14 14 14 1433 33 33 27 33 27 27 27 35 35 35 35 10 10 10 10 27 27 27 27 27 33 33 33 33 10 35 35 35 10 35 10 10 10 35 33
  • 10. This is a in-place comparison based sorting algorithm. Here, a sub-list is always sorted. For example, the lower part of an array is maintained to be sorted. The array is searched Sequentially and unsorted items are moved and inserted into sorted sub-list.
  • 11. 14 33 27 3510 14 14 14 14 14 14 14 14 1433 33 33 33 27 27 27 27 10 10 10 10 35 35 35 35 27 27 27 27 27 33 33 33 10 10 10 10 10 33 35 35 35 35 35 33 We take an unsorted array for our example.
  • 13. Selection sort is a simple sorting algorithm . This sorting algorithm is a in-place Comparison based algorithm in which the list is divided into two parts, sorted Part at left end and unsorted part at right end. intially end sorted part is empty And unsorted part is entire list.
  • 14. We take the depicted array for our example : 14 33 27 10 35 14 10 10 10 10 10 10 10 1033 33 33 33 27 27 27 27 10 14 14 14 35 35 35 35 14 14 14 14 14 27 27 27 19 19 33 33 33 33 35 35 35 35 35 33 19 19 19 19 27 27 19 19 19 19
  • 16. Merge Sort is a sorting technique based on divide & conquer technique. With worst case time complexity being respected algorithms. Merge Sort first divides the array into equal halves & Then combines them in a sorted manner.
  • 17. To understand merge sort, we take an unsorted array as depicted below. 14 33 27 10 35 19 42 44 35 19 42 4414 33 27 10 14 33 27 10 35 19 42 44 14 33 27 10 35 19 42 44 14 33 10 27 19 35 42 44 Combine Them into another list
  • 18. 10 14 33 27 19 35 42 44 After final merging, the list should look like this : 10 14 19 27 33 35 42 44
  • 19. Quick sort is a highly efficient sorting algorithm and is based on partitioning of array Of data into smaller arrays. The quick sort partitions an array and then calls itself recursively twice to sort the resulting two sub arrays. This algorithm is quite efficient for large size data sets its average & worst case complexity are of 0.
  • 20. The below given image representation explains how to find pivot value in the way. 10 42 35 33 31 27 26 19 14 44 10 14 19 26 27 31 33 35 42 44
  • 22. Linear search is a very simple search algorithm. In this type search, a sequential search is made over all items one by one. Every items is checked & if a match founds them Particular item is returned otherwise search continues till the end of the data collection.
  • 23. Suppose that we find 33 in array element Linear Search 10 14 19 26 27 31 33 35 42 44 = 33 10 14 19 26 27 31 33 35 42 44
  • 24. Binary search is a fast search algorithm with run-time complexity of 0 (log n) . This search algorithm works on the principle of divide & compare. For this algorithm to work properly the data collection should be in sorted form.
  • 25. The below given is our sorted array and assume that we need to search location Of value 31 using binary search. 10 14 19 26 27 31 33 35 42 44 0 1 2 3 4 5 6 7 8 9 First, we shall determine the half of the array by using this formula- Mid = low + (high – low) / 2 Here it is, 0+(9-0) / 2 = 4(integer value of 4.5). So 4 is the mid of array. 10 14 19 26 27 31 33 35 42 44 0 1 2 3 4 5 6 7 8 9
  • 26. We change our low to mid + 1 and final the new value again. Low = mid + 1 Mid = low + (high – low) / 2 Our new mid 7 now. We compare the value stored at location 7 with our target value 31. 10 14 19 26 27 31 33 35 42 44 0 1 2 3 4 5 6 7 8 9 The value stored at location 7 is not match, rather it is less that what we are looking for. So the value must be in lower part from this location. 10 14 19 26 27 31 33 35 42 44 0 1 2 3 4 5 6 7 8 9
  • 27. So we calculate the mid again. This time is 5. 10 14 19 26 27 31 33 35 42 44 0 1 2 3 4 5 6 7 8 9 We compare the value stored ad location 5 with our target value. We find that is a match. 10 14 19 26 27 31 33 35 42 44 0 1 2 3 4 5 6 7 8 9 We conclude that the target value 31 is stored at location 5.
  • 29. End Of The Moment