algorithm-archive icon indicating copy to clipboard operation
algorithm-archive copied to clipboard

sorting code/algorithms to sorting_searching

Open LL-creator opened this issue 5 years ago • 5 comments

Hey guys I noticed that there are only a few sorting algorithms on the archive. I think we should add these: merge sort insertion sort quick sort breadth-first search depth-first search etc. especially because most classes first teach algorithms using sorting algorithms.

LL-creator avatar Oct 20 '20 17:10 LL-creator

A lot of people have suggested these, but we have been avoiding them thus far specifically because they are covered well in other places.

There are a few PRs up for a few chapters for these methods, so we'll see how them go.

Thanks for the suggestion!

leios avatar Oct 20 '20 18:10 leios

no problem man, I get it. Are you saying you still allow pull request for things like that or that you're moving away from that kind of stuff at the moment

LL-creator avatar Oct 23 '20 17:10 LL-creator

this is an implementation of selection sort by reference in c++:

void selectionSort(vector<T> &v) { if (!v.empty()) { size_t indexMin; for (size_t i = 0; i < v.size() - 1; ++i) { indexMin = i; for (size_t j = i + 1; j < v.size(); ++j) { if (v.at(j) < v.at(indexMin)) indexMin = j; } swap(v.at(i), v.at(indexMin)); } } }

ODAncona avatar Feb 22 '21 20:02 ODAncona

Hi, thank you for your interest for improving the AAA. However, in effect, your code is unusable for us. In the future, if you want to contribute code, please open a pull request and follow the instructions laid out in the wiki (https://github.com/algorithm-archivists/algorithm-archive/wiki/How-to-Contribute) We are trying to add better and more extensive explaining chapters to the sorting, so we decided to remove the sorting chapters from the AAA for now, with the plan to re-add them later, better than they used to be.

I hope to see you contribute further to the AAA if you will.

Amaras avatar Feb 22 '21 20:02 Amaras

I think we should close this issue for now, until @leios restarts writing sorting chapters. I won't close it myself, though.

Amaras avatar Oct 25 '21 13:10 Amaras