#mergesort — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #mergesort, aggregated by home.social.
-
Knuth's merge-sort in C. Definitely in the style of mathematician programming.
-
Knuth's merge-sort in C. Definitely in the style of mathematician programming.
-
☑️ Day 8/100: #Leetcode daily question
🟨 Question: 179. Largest Number
Today's question was good and can be answered using a custom sorting function. I did this with 3 approaches:
1. Built-in sort (provided custom key fn).
2. #quicksort
3. #MergeSort🐈⬛ Check out my #GitHub where I post all the daily streak 🔥 questions and #LeetcodeContest 🏆 solutions
🔗 Solution Link: https://github.com/akshatsingh1718/leetcode/tree/main/largestNumber
🔗 My Leetcode Github: https://github.com/akshatsingh1718/leetcode
-
Kuth’s Merge Sort in C
Taken from Knuth Algorithm S mergesort P162-163 Vol 3 Second edition 1998
The major change is that the scratch buffer is not required to be adjacent and there are some changes because C array indexing usually starts with 0. This is very much how a mathematician write code. You have to remember a larger than usual single letter variables and it has a very clever clockwork
https://www.yodaiken.com/2024/01/24/kuths-merge-sort-in-c/
#theory #clang #Knuth #mergesort