SlideShare une entreprise Scribd logo
1  sur  10
Télécharger pour lire hors ligne
Parallel quicksort
Sylwia Dzikiewicz
Marta Leniewska
Mikołaj Olszewski
Marcin Woch
Michał Żelazowski
Sequential quicksort
 Quicksort

(Array, start, end)

If (start < end)
middle = partition (Array, start, end)
quicksort(Array, start, middle)
quicksort(Array, middle+1, end)
Sequential quicksort
 Partition

(Array, start, end)

X = Array [start]
I = start - 1
J = end + 1
while TRUE
repeat J = J –1 until Array [ J ] <= X
repeat I = I +1 until Array [ I ] >=X
if I < J swap (Array [ I ], Array [ J ] )
else return J
Sequential quicksort – complexity
analysis
 Pessimistic
–

O (n2)

 Average
–

complexity

complexity

O (n log n)
Parallel quicksort
P a r a lle l q u ic k s o rt
Q s o rt
Q s o rt
Q s o rt

Q s o rt

Q s o rt

Q s o rt

Q s o rt

Q s o rt

Q s o rt

Q s o rt

Q s o rt
Parallel quicksort


How a single processor makes QuickSort (Array, start,
end)
–
–
–
–
–

J = Partition (Array, start, end)
Start a new thread on another processor : QuickSort(Array,
start, J)
Start a new thread on another processor : QuickSort(Array,
J+1, end)
Wait for both threads to complete
Notice your parent that your task is finished
Parallel quicksort
 OR
–
–
–
–
–

:

J = Partition (Array, start, end)
Start a new thread on another processor :
QuickSort(Array, start, J)
Execute QuickSort(Array, J+1, end)
Wait for the thread to complete
Notice your parent that your task is finished
Parallel quicksort
 In

case no processor can take thread, the
thread is put into a queue for later processing.
 After a processor has done its task, it checks
whether the queue contains any waiting
threads. If so, it removes the first task from the
queue and processes it.
Parallel quicksort
 Methods
–
–
–

of choosing the split key

First element
Average of : first, last and medium element
Median (the median of a sample is expected to be
the median of the whole array)
Parallel quicksort
A

new thread is created only if the length of the
array to sort is no less than MIN_ARRAY_SIZE
constant
 If the length of the array to sort is less than
MIN_QUICKSORT_SIZE, the array is sorted
using a simple algorithm (eg. Insertionsort or
Selectionsort), which require no new threads.
 MIN_QUICKSORT_SIZE <=
MIN_ARRAY_SIZE

Contenu connexe

Tendances

State space search and Problem Solving techniques
State space search and Problem Solving techniquesState space search and Problem Solving techniques
State space search and Problem Solving techniquesKirti Verma
 
Greedy Algorithm - Knapsack Problem
Greedy Algorithm - Knapsack ProblemGreedy Algorithm - Knapsack Problem
Greedy Algorithm - Knapsack ProblemMadhu Bala
 
Ll(1) Parser in Compilers
Ll(1) Parser in CompilersLl(1) Parser in Compilers
Ll(1) Parser in CompilersMahbubur Rahman
 
Divide and Conquer - Part 1
Divide and Conquer - Part 1Divide and Conquer - Part 1
Divide and Conquer - Part 1Amrinder Arora
 
Parallel sorting Algorithms
Parallel  sorting AlgorithmsParallel  sorting Algorithms
Parallel sorting AlgorithmsGARIMA SHAKYA
 
Basic Garbage Collection Techniques
Basic  Garbage  Collection  TechniquesBasic  Garbage  Collection  Techniques
Basic Garbage Collection TechniquesAn Khuong
 
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERS
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERSVTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERS
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERSvtunotesbysree
 
Parallel algorithms
Parallel algorithmsParallel algorithms
Parallel algorithmsguest084d20
 
Decision tree induction \ Decision Tree Algorithm with Example| Data science
Decision tree induction \ Decision Tree Algorithm with Example| Data scienceDecision tree induction \ Decision Tree Algorithm with Example| Data science
Decision tree induction \ Decision Tree Algorithm with Example| Data scienceMaryamRehman6
 

Tendances (20)

Parallel Algorithms
Parallel AlgorithmsParallel Algorithms
Parallel Algorithms
 
5.1 greedy
5.1 greedy5.1 greedy
5.1 greedy
 
Chap1 slides
Chap1 slidesChap1 slides
Chap1 slides
 
State space search and Problem Solving techniques
State space search and Problem Solving techniquesState space search and Problem Solving techniques
State space search and Problem Solving techniques
 
Greedy Algorithm - Knapsack Problem
Greedy Algorithm - Knapsack ProblemGreedy Algorithm - Knapsack Problem
Greedy Algorithm - Knapsack Problem
 
parallel Merging
parallel Mergingparallel Merging
parallel Merging
 
Ll(1) Parser in Compilers
Ll(1) Parser in CompilersLl(1) Parser in Compilers
Ll(1) Parser in Compilers
 
Divide and Conquer - Part 1
Divide and Conquer - Part 1Divide and Conquer - Part 1
Divide and Conquer - Part 1
 
Quick sort
Quick sortQuick sort
Quick sort
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithms
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquer
 
Parallel sorting Algorithms
Parallel  sorting AlgorithmsParallel  sorting Algorithms
Parallel sorting Algorithms
 
04 Multi-layer Feedforward Networks
04 Multi-layer Feedforward Networks04 Multi-layer Feedforward Networks
04 Multi-layer Feedforward Networks
 
Basic Garbage Collection Techniques
Basic  Garbage  Collection  TechniquesBasic  Garbage  Collection  Techniques
Basic Garbage Collection Techniques
 
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERS
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERSVTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERS
VTU 5TH SEM CSE OPERATING SYSTEMS SOLVED PAPERS
 
Branch & bound
Branch & boundBranch & bound
Branch & bound
 
Daa unit 4
Daa unit 4Daa unit 4
Daa unit 4
 
Randomized algorithms ver 1.0
Randomized algorithms ver 1.0Randomized algorithms ver 1.0
Randomized algorithms ver 1.0
 
Parallel algorithms
Parallel algorithmsParallel algorithms
Parallel algorithms
 
Decision tree induction \ Decision Tree Algorithm with Example| Data science
Decision tree induction \ Decision Tree Algorithm with Example| Data scienceDecision tree induction \ Decision Tree Algorithm with Example| Data science
Decision tree induction \ Decision Tree Algorithm with Example| Data science
 

Similaire à Parallel quicksort cz. 1

Quick sort by Sania Nisar
Quick sort by Sania NisarQuick sort by Sania Nisar
Quick sort by Sania NisarSania Nisar
 
Dsa – data structure and algorithms sorting
Dsa – data structure and algorithms  sortingDsa – data structure and algorithms  sorting
Dsa – data structure and algorithms sortingsajinis3
 
Algorithms with-java-advanced-1.0
Algorithms with-java-advanced-1.0Algorithms with-java-advanced-1.0
Algorithms with-java-advanced-1.0BG Java EE Course
 
Class13_Quicksort_Algorithm.pdf
Class13_Quicksort_Algorithm.pdfClass13_Quicksort_Algorithm.pdf
Class13_Quicksort_Algorithm.pdfAkashSingh625550
 
CSE680-07QuickSort.pptx
CSE680-07QuickSort.pptxCSE680-07QuickSort.pptx
CSE680-07QuickSort.pptxDeepakM509554
 
Selection sort
Selection sortSelection sort
Selection sortasra khan
 
An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...
An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...
An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...Tosin Amuda
 
Selection sort
Selection sortSelection sort
Selection sortamna izzat
 
Selection sort lab mannual
Selection sort lab mannualSelection sort lab mannual
Selection sort lab mannualmaamir farooq
 
Algorithms - "Chapter 2 getting started"
Algorithms - "Chapter 2 getting started"Algorithms - "Chapter 2 getting started"
Algorithms - "Chapter 2 getting started"Ra'Fat Al-Msie'deen
 
Chp-1 Quick Review of basic concepts.pdf
Chp-1 Quick Review of basic concepts.pdfChp-1 Quick Review of basic concepts.pdf
Chp-1 Quick Review of basic concepts.pdfSolomonMolla4
 
Sorting Algorithms.
Sorting Algorithms.Sorting Algorithms.
Sorting Algorithms.Saket Kumar
 

Similaire à Parallel quicksort cz. 1 (20)

Quick sort by Sania Nisar
Quick sort by Sania NisarQuick sort by Sania Nisar
Quick sort by Sania Nisar
 
Dsa – data structure and algorithms sorting
Dsa – data structure and algorithms  sortingDsa – data structure and algorithms  sorting
Dsa – data structure and algorithms sorting
 
Sorting pnk
Sorting pnkSorting pnk
Sorting pnk
 
Sorting
SortingSorting
Sorting
 
Algorithms with-java-advanced-1.0
Algorithms with-java-advanced-1.0Algorithms with-java-advanced-1.0
Algorithms with-java-advanced-1.0
 
Class13_Quicksort_Algorithm.pdf
Class13_Quicksort_Algorithm.pdfClass13_Quicksort_Algorithm.pdf
Class13_Quicksort_Algorithm.pdf
 
CSE680-07QuickSort.pptx
CSE680-07QuickSort.pptxCSE680-07QuickSort.pptx
CSE680-07QuickSort.pptx
 
Selection sort
Selection sortSelection sort
Selection sort
 
Sorting algorithms
Sorting algorithmsSorting algorithms
Sorting algorithms
 
An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...
An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...
An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...
 
Sorting algorithms
Sorting algorithmsSorting algorithms
Sorting algorithms
 
Selection sort
Selection sortSelection sort
Selection sort
 
simple-sorting algorithms
simple-sorting algorithmssimple-sorting algorithms
simple-sorting algorithms
 
Selection sort
Selection sortSelection sort
Selection sort
 
Selection sort lab mannual
Selection sort lab mannualSelection sort lab mannual
Selection sort lab mannual
 
Algorithms - "Chapter 2 getting started"
Algorithms - "Chapter 2 getting started"Algorithms - "Chapter 2 getting started"
Algorithms - "Chapter 2 getting started"
 
Chp-1 Quick Review of basic concepts.pdf
Chp-1 Quick Review of basic concepts.pdfChp-1 Quick Review of basic concepts.pdf
Chp-1 Quick Review of basic concepts.pdf
 
Data Structures 6
Data Structures 6Data Structures 6
Data Structures 6
 
Lec 03 - Sorting.pptx
Lec 03 - Sorting.pptxLec 03 - Sorting.pptx
Lec 03 - Sorting.pptx
 
Sorting Algorithms.
Sorting Algorithms.Sorting Algorithms.
Sorting Algorithms.
 

Plus de Mikołaj Olszewski

The metadata driven e-laboratory web client
The metadata driven e-laboratory web clientThe metadata driven e-laboratory web client
The metadata driven e-laboratory web clientMikołaj Olszewski
 
Optoelektroniczne modelowanie sieci neuronowej cz. 1
Optoelektroniczne modelowanie sieci neuronowej cz. 1Optoelektroniczne modelowanie sieci neuronowej cz. 1
Optoelektroniczne modelowanie sieci neuronowej cz. 1Mikołaj Olszewski
 
Programowanie Komponentowe: #E Podsumowanie
Programowanie Komponentowe: #E PodsumowanieProgramowanie Komponentowe: #E Podsumowanie
Programowanie Komponentowe: #E PodsumowanieMikołaj Olszewski
 
Programowanie Komponentowe: #D Model komponentowy OSGi
Programowanie Komponentowe: #D Model komponentowy OSGiProgramowanie Komponentowe: #D Model komponentowy OSGi
Programowanie Komponentowe: #D Model komponentowy OSGiMikołaj Olszewski
 
Programowanie Komponentowe: #C Wprowadzenie do OSGi
Programowanie Komponentowe: #C Wprowadzenie do OSGiProgramowanie Komponentowe: #C Wprowadzenie do OSGi
Programowanie Komponentowe: #C Wprowadzenie do OSGiMikołaj Olszewski
 
Programowanie Komponentowe: #B Komponentowe aspekty springa
Programowanie Komponentowe: #B Komponentowe aspekty springaProgramowanie Komponentowe: #B Komponentowe aspekty springa
Programowanie Komponentowe: #B Komponentowe aspekty springaMikołaj Olszewski
 
Optoelektroniczne sieci neuronowe
Optoelektroniczne sieci neuronoweOptoelektroniczne sieci neuronowe
Optoelektroniczne sieci neuronoweMikołaj Olszewski
 
Programowanie Komponentowe: #A Wprowadzenie do Springa
Programowanie Komponentowe: #A Wprowadzenie do SpringaProgramowanie Komponentowe: #A Wprowadzenie do Springa
Programowanie Komponentowe: #A Wprowadzenie do SpringaMikołaj Olszewski
 
Programowanie Komponentowe: #9 Java Beans
Programowanie Komponentowe: #9 Java BeansProgramowanie Komponentowe: #9 Java Beans
Programowanie Komponentowe: #9 Java BeansMikołaj Olszewski
 
Optyczne solitony przestrzenne
Optyczne solitony przestrzenneOptyczne solitony przestrzenne
Optyczne solitony przestrzenneMikołaj Olszewski
 
Kwantowe struktury półprzewodnikowe
Kwantowe struktury półprzewodnikoweKwantowe struktury półprzewodnikowe
Kwantowe struktury półprzewodnikoweMikołaj Olszewski
 
Programowanie Komponentowe: #7 Programowanie asynchroniczne i sterowane zdarz...
Programowanie Komponentowe: #7 Programowanie asynchroniczne i sterowane zdarz...Programowanie Komponentowe: #7 Programowanie asynchroniczne i sterowane zdarz...
Programowanie Komponentowe: #7 Programowanie asynchroniczne i sterowane zdarz...Mikołaj Olszewski
 
Metody efektywnego łączenia sieci neuronowych
Metody efektywnego łączenia sieci neuronowychMetody efektywnego łączenia sieci neuronowych
Metody efektywnego łączenia sieci neuronowychMikołaj Olszewski
 
Programowanie Komponentowe: #6 Wersjonowanie
Programowanie Komponentowe: #6 WersjonowanieProgramowanie Komponentowe: #6 Wersjonowanie
Programowanie Komponentowe: #6 WersjonowanieMikołaj Olszewski
 

Plus de Mikołaj Olszewski (20)

Architektura heksagonalna
Architektura heksagonalnaArchitektura heksagonalna
Architektura heksagonalna
 
The metadata driven e-laboratory web client
The metadata driven e-laboratory web clientThe metadata driven e-laboratory web client
The metadata driven e-laboratory web client
 
Optoelektroniczne modelowanie sieci neuronowej cz. 1
Optoelektroniczne modelowanie sieci neuronowej cz. 1Optoelektroniczne modelowanie sieci neuronowej cz. 1
Optoelektroniczne modelowanie sieci neuronowej cz. 1
 
Programowanie Komponentowe: #E Podsumowanie
Programowanie Komponentowe: #E PodsumowanieProgramowanie Komponentowe: #E Podsumowanie
Programowanie Komponentowe: #E Podsumowanie
 
Programowanie Komponentowe: #D Model komponentowy OSGi
Programowanie Komponentowe: #D Model komponentowy OSGiProgramowanie Komponentowe: #D Model komponentowy OSGi
Programowanie Komponentowe: #D Model komponentowy OSGi
 
Programowanie Komponentowe: #C Wprowadzenie do OSGi
Programowanie Komponentowe: #C Wprowadzenie do OSGiProgramowanie Komponentowe: #C Wprowadzenie do OSGi
Programowanie Komponentowe: #C Wprowadzenie do OSGi
 
Programowanie Komponentowe: #B Komponentowe aspekty springa
Programowanie Komponentowe: #B Komponentowe aspekty springaProgramowanie Komponentowe: #B Komponentowe aspekty springa
Programowanie Komponentowe: #B Komponentowe aspekty springa
 
Optoelektroniczne sieci neuronowe
Optoelektroniczne sieci neuronoweOptoelektroniczne sieci neuronowe
Optoelektroniczne sieci neuronowe
 
Programowanie Komponentowe: #A Wprowadzenie do Springa
Programowanie Komponentowe: #A Wprowadzenie do SpringaProgramowanie Komponentowe: #A Wprowadzenie do Springa
Programowanie Komponentowe: #A Wprowadzenie do Springa
 
Materiały fotorefrakcyjne
Materiały fotorefrakcyjneMateriały fotorefrakcyjne
Materiały fotorefrakcyjne
 
Programowanie Komponentowe: #9 Java Beans
Programowanie Komponentowe: #9 Java BeansProgramowanie Komponentowe: #9 Java Beans
Programowanie Komponentowe: #9 Java Beans
 
Lokalne sieci światłowodowe
Lokalne sieci światłowodoweLokalne sieci światłowodowe
Lokalne sieci światłowodowe
 
Optyczne solitony przestrzenne
Optyczne solitony przestrzenneOptyczne solitony przestrzenne
Optyczne solitony przestrzenne
 
Swiatłowodowy czujnik prądu
Swiatłowodowy czujnik prąduSwiatłowodowy czujnik prądu
Swiatłowodowy czujnik prądu
 
Optyka ciekłych kryształów
Optyka ciekłych kryształówOptyka ciekłych kryształów
Optyka ciekłych kryształów
 
Kwantowe struktury półprzewodnikowe
Kwantowe struktury półprzewodnikoweKwantowe struktury półprzewodnikowe
Kwantowe struktury półprzewodnikowe
 
Programowanie Komponentowe: #7 Programowanie asynchroniczne i sterowane zdarz...
Programowanie Komponentowe: #7 Programowanie asynchroniczne i sterowane zdarz...Programowanie Komponentowe: #7 Programowanie asynchroniczne i sterowane zdarz...
Programowanie Komponentowe: #7 Programowanie asynchroniczne i sterowane zdarz...
 
Metody efektywnego łączenia sieci neuronowych
Metody efektywnego łączenia sieci neuronowychMetody efektywnego łączenia sieci neuronowych
Metody efektywnego łączenia sieci neuronowych
 
Parallel quicksort cz. 2
Parallel quicksort cz. 2Parallel quicksort cz. 2
Parallel quicksort cz. 2
 
Programowanie Komponentowe: #6 Wersjonowanie
Programowanie Komponentowe: #6 WersjonowanieProgramowanie Komponentowe: #6 Wersjonowanie
Programowanie Komponentowe: #6 Wersjonowanie
 

Dernier

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 

Dernier (20)

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

Parallel quicksort cz. 1

  • 1. Parallel quicksort Sylwia Dzikiewicz Marta Leniewska Mikołaj Olszewski Marcin Woch Michał Żelazowski
  • 2. Sequential quicksort  Quicksort (Array, start, end) If (start < end) middle = partition (Array, start, end) quicksort(Array, start, middle) quicksort(Array, middle+1, end)
  • 3. Sequential quicksort  Partition (Array, start, end) X = Array [start] I = start - 1 J = end + 1 while TRUE repeat J = J –1 until Array [ J ] <= X repeat I = I +1 until Array [ I ] >=X if I < J swap (Array [ I ], Array [ J ] ) else return J
  • 4. Sequential quicksort – complexity analysis  Pessimistic – O (n2)  Average – complexity complexity O (n log n)
  • 5. Parallel quicksort P a r a lle l q u ic k s o rt Q s o rt Q s o rt Q s o rt Q s o rt Q s o rt Q s o rt Q s o rt Q s o rt Q s o rt Q s o rt Q s o rt
  • 6. Parallel quicksort  How a single processor makes QuickSort (Array, start, end) – – – – – J = Partition (Array, start, end) Start a new thread on another processor : QuickSort(Array, start, J) Start a new thread on another processor : QuickSort(Array, J+1, end) Wait for both threads to complete Notice your parent that your task is finished
  • 7. Parallel quicksort  OR – – – – – : J = Partition (Array, start, end) Start a new thread on another processor : QuickSort(Array, start, J) Execute QuickSort(Array, J+1, end) Wait for the thread to complete Notice your parent that your task is finished
  • 8. Parallel quicksort  In case no processor can take thread, the thread is put into a queue for later processing.  After a processor has done its task, it checks whether the queue contains any waiting threads. If so, it removes the first task from the queue and processes it.
  • 9. Parallel quicksort  Methods – – – of choosing the split key First element Average of : first, last and medium element Median (the median of a sample is expected to be the median of the whole array)
  • 10. Parallel quicksort A new thread is created only if the length of the array to sort is no less than MIN_ARRAY_SIZE constant  If the length of the array to sort is less than MIN_QUICKSORT_SIZE, the array is sorted using a simple algorithm (eg. Insertionsort or Selectionsort), which require no new threads.  MIN_QUICKSORT_SIZE <= MIN_ARRAY_SIZE