algorithm-archivists / algorithm-archive

A collaborative book on algorithms
https://www.algorithm-archive.org
MIT License
2.38k stars 357 forks source link

sorting code/algorithms to sorting_searching #772

Open LL-creator opened 4 years ago

LL-creator commented 4 years ago

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.

leios commented 4 years ago

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!

LL-creator commented 4 years ago

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

ODAncona commented 3 years ago

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

void selectionSort(vector &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)); } } }

Amaras commented 3 years ago

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 commented 3 years ago

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