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

Latest commit

History

History
21 lines (14 loc) 路 441 Bytes

sort.md

File metadata and controls

21 lines (14 loc) 路 441 Bytes

sort

Description : sort() function is used to sort the elements of the container by changing their positions.

Example :

    // list declaration of integer type 
    std::list<int> mylist{ 1, 5, 3, 2, 4 }; 
  
    // sort function 
    mylist.sort(); 
  
    // printing the list after sort 
    for (auto value : mylist) {
        std::cout << value << " "; 
    }

Run Code