You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- template <class C>
- void selectionsort (C& a)
- {
- for (int i=0; i<a.size()-1; i=i+1)
- { // i Elemente sind sortiert
- int min = i;
- for (int j=i+1; j<a.size(); j=j+1)
- if (a[j]<a[min]) min=j;
- std::swap(a[i],a[min]);
- }
- }
|