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 insertionsort (C& a) {
- for (int i=1; i<a.size(); i=i+1) {
- // i Elemente sind sortiert
- int j=i;
- while (j>0 && a[j-1]>a[j]) {
- std::swap(a[j], a[j-1]);
- j=j-1;
- }
- }
- }
|