Quick sort

Vediamo un brese e semplice esempio realizzato in c++ di ordinamento QUICK SORT

Problema: Ordinare un array di 7 elementi (3 5 7 3 4 6 2) utilizzando l’algoritmo di ordinamento

Codice.cpp

#include <iostream>
 
 
using namespace std;
 
int FindPivot(int A[],int i,int j){
 for(int k=i+1; k< =j;k++){
 if(A[k] > A[i]){
 return A[k];
 }else if(A[k]<A[i]){
 return A[i];
 }
 }
 return (-1);
}
 
</iostream>
Tothebit

About Tothebit

How to whitelist website on AdBlocker?

How to whitelist website on AdBlocker?

  1. 1 Click on the AdBlock Plus icon on the top right corner of your browser
  2. 2 Click on "Enabled on this site" from the AdBlock Plus option
  3. 3 Refresh the page and start browsing the site