Selection Sort X33871


Statement
 

pdf   zip

html

Write a procedure

void sort(vector<double>& V);

that sorts V in increasing order using the selection sort algorithm.

Observation You only need to submit the required procedure; your main program will be ignored.

Public test cases
  • Input

    1
    

    Output

    2
    
  • Input

    -1
    

    Output

    0
    
  • Input

    0
    

    Output

    1
    
  • Input

    2
    

    Output

    3
    
  • Information
    Author
    Héctor Barriga
    Language
    English
    Translator
    Carlos Molina
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    Python
    User solutions
    Python