edrickhong / Cu_std

A library I made developed alongside Cu
MIT License
0 stars 1 forks source link

Add this into the sorting algo -- along w others #5

Open edrickhong opened 3 years ago

edrickhong commented 3 years ago

// Eg of an insertion sort void InsertionSort(vector& array) { for (u32 i = 0; i < array.size() - 1; i++) { for (u32 j = i + 1; j < array.size(); j++) { u32 a = array[i]; u32 b = array[j];

        if (a > b) {
            array.erase(array.begin() + j);
            array.insert(array.begin() + i, b);
        }
    }
}

}

edrickhong commented 2 years ago

we have written other sorting algorithms since then. we should add these in. Also idk if I want to use add insertion sort at all at this point as we will never want to use it. Maybe just for archival purposed??