Zulip Chat Archive
Stream: CSLib
Topic: Contributing other sorting algorithms?
Harry Goldstein (Feb 27 2026 at 02:11):
I have a couple of students who may want to make small (relatively beginner) CSLib contributions over the next few months. I was thinking I could have them contribute a couple of sorting algorithms (e.g., insertion sort), and associated time complexity proofs, in the style of the merge sort example. Would that kind of thing be accepted as a contribution (assuming I worked with the students to make sure everything was styled and set up correctly)?
Eric Wieser (Feb 27 2026 at 02:28):
I think there are at least 4 PRs that contribute insertionSort in some form, so probably another one is not that helpful a contribution
Eric Wieser (Feb 27 2026 at 02:29):
I'm not sure I've seen one for bubble sort anyway though
Harry Goldstein (Feb 27 2026 at 02:32):
Oh I see. I had looked through the issues but not the PRs. Fair enough. I can look for other sorting algorithms and similar CS 1 or CS 2 style algorithms. Also happy to take suggestions for other things that seem relatively easy but that no one currently has the appetite to tackle.
Ching-Tsun Chou (Feb 27 2026 at 03:49):
Perhaps it would be interesting to formalize some non-comparison sort algorithms like radix sort.
Chris Henson (Feb 27 2026 at 03:50):
Yes, I unfortunately don't think the issues have much at the moment that is great for beginners. Many of them are me leaving a paper trail of technical chores. I think it would be fine to work on some sorting algorithm other than insertion sort.
Shreyas Srinivas (Feb 27 2026 at 06:09):
@Harry Goldstein : I’d like to see a binary search algorithm for lists on top of the Prog model in PR cslib#372. It can use the ListSearch model.
Shreyas Srinivas (Feb 27 2026 at 06:10):
It’s not too difficult, but still hard enough for new students learning lean.
Shreyas Srinivas (Feb 27 2026 at 06:14):
I’d also recommend quicksort, though in this case I would also suggest using a model similar to SortOpsCmp, but using Vectors, and changing the cmpLT query to compare an argument against a given index of the vector.
Shreyas Srinivas (Feb 27 2026 at 06:14):
So that’s slightly harder and requires students to think about what is being counted carefully.
Shreyas Srinivas (Feb 27 2026 at 06:33):
I would even suggest selection sort on Vectors. That should be much simpler than quicksort
Last updated: Feb 28 2026 at 14:05 UTC