Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Latest commit

 

History

History
27 lines (19 loc) · 584 Bytes

sort.md

File metadata and controls

27 lines (19 loc) · 584 Bytes

sort

Description : This function is implemented as Quick-sort. The complexity of it is O(N*log(N)).

Example :

    void show(int a[]) { 
        for(int i = 0; i < 10;   i) 
            std::cout << a[i] << " "; 
    } 
  
    int main() {

        int a[10]= {1, 5, 8, 9, 6, 7, 3, 4, 2, 0}; 
        std::cout << "\n The array before sorting is : "; 
        show(a); 
  
        std::sort(a, a 10); 
  
        std::cout << "\n\n The array after sorting is : "; 
        show(a); 
  
        return 0; 
} 

Run Code