SlideShare una empresa de Scribd logo
1 de 66
Descargar para leer sin conexión
ALGORITHM
ALGORITHM
SORT
Selection Sort Quick Sort
ALGORITHM
SORT INTRO
What is Sort?
ALGORITHM
SORT INTRO
Make data in Sequence
4 3 8 6 7 13 10 14 9
3 4 6 7 8 9 10 13 14
ALGORITHM
SORT INTRO
Make data in Sequence
Key
(comparing data)
Sort Order
(Ascending, Descending)
Sort
Efficiency
(time complexity)
Sort
Stability
(keep sort order)
ALGORITHM
SORT Selection Sort
Selection Sort
ALGORITHM
SORT Selection Sort
select best-fit-data every time
s s d d .. d d d d
sorted unsorted
select data fits this position
ALGORITHM
SORT Selection Sort
4 3 8 6 7 13 10 14 9
Selection Sort in Ascend order
Min Data
unsorted
ALGORITHM
SORT Selection Sort
3 4 8 6 7 13 10 14 9
Selection Sort in Ascend order
unsorted
swap
sorted
ALGORITHM
SORT Selection Sort
3 4 8 6 7 13 10 14 9
Selection Sort in Ascend order
unsortedsorted
Min Data
ALGORITHM
SORT Selection Sort
3 4 8 6 7 13 10 14 9
Selection Sort in Ascend order
unsortedsorted
ALGORITHM
SORT Selection Sort
3 4 8 6 7 13 10 14 9
Selection Sort in Ascend order
unsortedsorted
Min Data
ALGORITHM
SORT Selection Sort
3 4 6 8 7 13 10 14 9
Selection Sort in Ascend order
unsortedsorted
swap
ALGORITHM
SORT Selection Sort
3 4 6 8 7 13 10 14 9
Selection Sort in Ascend order
unsortedsorted
Min Data
ALGORITHM
SORT Selection Sort
3 4 6 7 8 13 10 14 9
Selection Sort in Ascend order
unsortedsorted
swap
ALGORITHM
SORT Selection Sort
3 4 6 7 8 13 10 14 9
Selection Sort in Ascend order
unsortedsorted
Min Data
ALGORITHM
SORT Selection Sort
3 4 6 7 8 13 10 14 9
Selection Sort in Ascend order
unsortedsorted
ALGORITHM
SORT Selection Sort
3 4 6 7 8 13 10 14 9
Selection Sort in Ascend order
unsortedsorted
Min Data
ALGORITHM
SORT Selection Sort
3 4 6 7 8 9 10 14 13
Selection Sort in Ascend order
unsortedsorted
swap
ALGORITHM
SORT Selection Sort
3 4 6 7 8 9 10 14 13
Selection Sort in Ascend order
unsortedsorted
Min Data
ALGORITHM
SORT Selection Sort
3 4 6 7 8 9 10 14 13
Selection Sort in Ascend order
unsortedsorted
ALGORITHM
SORT Selection Sort
3 4 6 7 8 9 10 14 13
Selection Sort in Ascend order
unsortedsorted
Min Data
ALGORITHM
SORT Selection Sort
3 4 6 7 8 9 10 13 14
Selection Sort in Ascend order
unsortedsorted
swap
ALGORITHM
SORT Selection Sort
3 4 6 7 8 9 10 13 14
Selection Sort in Ascend order
sorted
ALGORITHM
SORT Quick Sort
Quick Sort
divide dataset with pivot
s … p ... d d d d d
less than p bigger than p
pivot
ALGORITHM
SORT Quick Sort
select pivot
ALGORITHM
SORT Quick Sort
4 3 8 6 7 13 2 14 9
pivot
left right
Move left to first data bigger than pivot
ALGORITHM
SORT Quick Sort
4 3 8 6 7 13 2 14 9
pivot
left right
Move right to first data less than pivot
ALGORITHM
SORT Quick Sort
4 3 8 6 7 13 2 14 9
pivot
left right
swap left and right
ALGORITHM
SORT Quick Sort
4 3 2 6 7 13 8 14 9
pivot
left right
Move left to first data bigger than pivot
ALGORITHM
SORT Quick Sort
4 3 2 6 7 13 8 14 9
pivot
left right
Move right to first data less than pivot
ALGORITHM
SORT Quick Sort
4 3 2 6 7 13 8 14 9
pivot
left
right
swap right with pivot
ALGORITHM
SORT Quick Sort
2 3 4 6 7 13 8 14 9
pivot
swap right with pivot
ALGORITHM
SORT Quick Sort
2 3 4 6 7 13 8 14 9
pivot
less than 4 bigger than 4
sorting problem divided into two problems
ALGORITHM
SORT Quick Sort
2 3 4 6 7 13 8 14 9
less than 4 bigger than 4
sort left partition
ALGORITHM
SORT Quick Sort
2 3
pivot
left
right
Move left to first data bigger than pivot
ALGORITHM
SORT Quick Sort
2 3
pivot
left
right
Move right to first data less than pivot
ALGORITHM
SORT Quick Sort
2 3
pivot
left
right
sorted
ALGORITHM
SORT Quick Sort
2 3
try right part
ALGORITHM
SORT Quick Sort
2 3 4 6 7 13 8 14 9
sorted bigger than 4
sort right partition
ALGORITHM
SORT Quick Sort
6 7 13 8 14 9
pivot
left
right
ALGORITHM
SORT Quick Sort
6 7 13 8 14 9
pivot
left
right
Move left to first data bigger than pivot
ALGORITHM
SORT Quick Sort
6 7 13 8 14 9
pivot
left
right
Move right to first data less than pivot
ALGORITHM
SORT Quick Sort
sorting problem divided into two problems but left is none
6 7 13 8 14 9…
bigger than 6
ALGORITHM
SORT Quick Sort
sort right partition
7 13 8 14 9
pivot
left
right
ALGORITHM
SORT Quick Sort
7 13 8 14 9
pivot
left
right
Move left to first data bigger than pivot
ALGORITHM
SORT Quick Sort
7 13 8 14 9
pivot
left
right
Move right to first data less than pivot
ALGORITHM
SORT Quick Sort
7 13 8 14 9…
bigger than 7
sorting problem divided into two problems but left is none
ALGORITHM
SORT Quick Sort
13 8 14 9
sort right partition
pivot
left
right
ALGORITHM
SORT Quick Sort
13 8 14 9
pivot
left
right
Move left to first data bigger than pivot
ALGORITHM
SORT Quick Sort
13 8 14 9
pivot
left
Move right to first data less than pivot
right
ALGORITHM
SORT Quick Sort
13 8 9 14
pivot
left
right
swap left and right
ALGORITHM
SORT Quick Sort
9 8 13 14
pivot
swap pivot and right
right
ALGORITHM
SORT Quick Sort
9 8 13 14
less than 13 bigger than 13
sorting problem divided into two problems
ALGORITHM
SORT Quick Sort
9 8 13 14
less than 13 sorted
no need to sort one element
ALGORITHM
SORT Quick Sort
9 8
sort left partition
pivot
left
right
ALGORITHM
SORT Quick Sort
9 8
pivot
left
right
Move left to first data bigger than pivot
ALGORITHM
SORT Quick Sort
9 8
pivot
left
right
Move right to first data less than pivot
ALGORITHM
SORT Quick Sort
8
Swap left and right
9
pivot
ALGORITHM
SORT Quick Sort
8
sorted
9
ALGORITHM
SORT Quick Sort
8
sorted
9
ALGORITHM
SORT Quick Sort
8 9 13 14
less than 13 sorted
sorted
ALGORITHM
SORT Quick Sort
sorted
7 8 9 13 14
bigger than 7
ALGORITHM
SORT Quick Sort
sorted
6 7 8 9 13 14
bigger than 6
sorted
ALGORITHM
SORT Quick Sort
2 3 4 6 7 8 9 13 14
sorted bigger than 4
sort complete
ALGORITHM
SORT Quick Sort
2 3 4 6 7 8 9 13 14
sorted

Más contenido relacionado

Último

online pdf editor software solutions.pdf
online pdf editor software solutions.pdfonline pdf editor software solutions.pdf
online pdf editor software solutions.pdfMeon Technology
 
Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsYour Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsJaydeep Chhasatia
 
Top Software Development Trends in 2024
Top Software Development Trends in  2024Top Software Development Trends in  2024
Top Software Development Trends in 2024Mind IT Systems
 
Cybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadCybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadIvo Andreev
 
Enterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze IncEnterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze Incrobinwilliams8624
 
Generative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilGenerative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilVICTOR MAESTRE RAMIREZ
 
eAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspectionseAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspectionsNirav Modi
 
Watermarking in Source Code: Applications and Security Challenges
Watermarking in Source Code: Applications and Security ChallengesWatermarking in Source Code: Applications and Security Challenges
Watermarking in Source Code: Applications and Security ChallengesShyamsundar Das
 
Webinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.pptWebinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.pptkinjal48
 
JS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIJS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIIvo Andreev
 
Growing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesGrowing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesSoftwareMill
 
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine HarmonyLeveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmonyelliciumsolutionspun
 
AI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human BeautyAI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human BeautyRaymond Okyere-Forson
 
Introduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntroduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntelliSource Technologies
 
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Jaydeep Chhasatia
 
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLBig Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLAlluxio, Inc.
 
ERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptxERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptxAutus Cyber Tech
 
Fields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptxFields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptxJoão Esperancinha
 
IA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeIA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeNeo4j
 

Último (20)

online pdf editor software solutions.pdf
online pdf editor software solutions.pdfonline pdf editor software solutions.pdf
online pdf editor software solutions.pdf
 
Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsYour Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
 
Top Software Development Trends in 2024
Top Software Development Trends in  2024Top Software Development Trends in  2024
Top Software Development Trends in 2024
 
Cybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadCybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and Bad
 
Enterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze IncEnterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze Inc
 
Generative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilGenerative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-Council
 
eAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspectionseAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspections
 
Watermarking in Source Code: Applications and Security Challenges
Watermarking in Source Code: Applications and Security ChallengesWatermarking in Source Code: Applications and Security Challenges
Watermarking in Source Code: Applications and Security Challenges
 
Webinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.pptWebinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.ppt
 
JS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIJS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AI
 
Growing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesGrowing Oxen: channel operators and retries
Growing Oxen: channel operators and retries
 
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine HarmonyLeveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
 
AI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human BeautyAI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human Beauty
 
Introduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntroduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptx
 
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
 
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLBig Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
 
Salesforce AI Associate Certification.pptx
Salesforce AI Associate Certification.pptxSalesforce AI Associate Certification.pptx
Salesforce AI Associate Certification.pptx
 
ERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptxERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptx
 
Fields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptxFields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptx
 
IA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeIA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG time
 

Intersection Study - Algorithm(Sort)