Filter
Exclude
Time range
-
Near
Shellsort is a pretty good nonrecursive alternative. I myself saw a situation where qsort had to replaced by it due to limited sack, workef fine.
2
95
Shellsort Evolved (gap sequence via evolutionary search) Result: 0.52% fewer comparisons than Ciura across N=1M–8M random permutations (total: 545,960,523 → 543,146,602 comps). Per-size improvements: 0.37%, 0.40%, 0.48%, 0.57% with paired t-tests p<0.001 each (paired on identical permutations). Sequence base (18): 1,4,10,23,57,132,301,701,1577,3524,7705,17961,40056,94681,199137,460316,1035711,3236462; extend >8M by ×2.25. Repro: master seed 0xC0FFEE1234, permutation gen validate steps in repo. github.com/imcynic/shellsort…
1
3
203
So Shellsort won't fall apart if objects' sorting values changes between passes, right?
1
3
679
Replying to @arpit_bhayani
I'm fairly certain there are better algorithms for this use case. Shellsort comes to mind.
2
46
9,191
¿Y para usted no es ciencia de la computación saber si existe un algoritmo para embeber en el plano a un árbol, o el desempeño en el peor de los casos del algoritmo Shellsort, o P=NP?
1
2
214
void shellsort(int *A, size_t n) { size_t i, j, k; int t; for (k = 3; k <= n/9; k = k*9/4 1); for (k = k*4/9; k; k = k*4/9) { for (i = k; i < n; i) { t = A[i]; for (j = i; k <= j && t < A[j-k]); j -= k) { A[j] = A[j-k]; } A[j] = t; } } }
1
2
3
134
20 Jul 2024
Replying to @MaverickAlbert5
Yes, and I deeply regret not taking the Algorithms class in college back in the day. Many decades ago I was working with very large amounts of data that I had to sort, so I looked in my K&R C programming language book and implemented the shellsort. It was crazy slow with the volumes of data I had to work with, and because I didn't really have any notion of complexity, I solved this by rewriting the sort in AT&T 3B2 assembly language. This was several days of effort. It was killer good for a shell sort, but still slow, and it was at that point that God whispered to me: "Use a better algorithm" I replaced all my fancy assembler code with the built-in library "qsort()" and boom it lit the sort on fire. A painful way to learn the importance of Algorithms. And as to Data Structures: absolutely. I did take this class, and my professor told me something that still rings true to me 40 years later. "If you show me your code, I might know what it does. If you show me your data structures, I don't need to see your code"
1
2
205
There is no one-size-fit-all solutions. All depends on the context: - Insertion sort is good for small inputs - Shellsort is good for medium size inputs. - Mergesort is O(NlogN) but requires additional space. - Quicksort is O(NlogN) but can be O(n^2)
1
151
25 Jan 2024
Wieso? VB für GUI und Fortran für Meat. Schon mal den Assemblercode eines Algorithmus wie z.B. Shellsort oder Quicksort, oder der Ungarischen Methode gesehen, der mit einem ordentlichen Fortran-Compiler übersetzt wurde?
2
24
21 Jan 2024
I recall one cool example from my advisor: naive analysis of circuit-depth building an n-bit counter (given n input bits and output log(n) bits representing number of 1s) Other examples are sorting network by shellsort, bitwise runtime for binary GCD, two level binary search...
2
692
There is no one-size-fit-all solutions. All depends on the context: - Insertion sort is good for small inputs - Shellsort is good for medium size inputs. - Mergesort is O(NlogN) but requires additional space. - Quicksort is O(NlogN) but can be O(n^2)
2
146
18 Dec 2023
I don't know about you but this lady right here...... 🙌🙌🙌🙌 #ALX_SE #sortingproject #shellsort
26
7
72
2,526
Replying to @RealGalego
shellsort
1
120
Day 24 of #100DaysOfCode: DSA Week 2: Elementary Sort Roadmap: ✅ Shellsort It's a bit confusing, so took me 2 days to understand. Feeling dumb sometimes 🙂.
2
15
262
Day 22 of #100DaysOfCode: DSA Week 2: Elementary Sort Roadmap: ✅ Selection sort ✅ Insertion sort ✅ Shellsort ✅ Shuffling ✅ Convex hull Following the roadmap and learning is one of the easiest thing.
2
25
1,695
24 Aug 2023
Replying to @grumpygiant
Personally I think it’s pretty narcissistic to incorrectly quote qsort as O(n log n) while citing the 1966 paper, as though the maintainers have never heard of it and chose shellsort out of pure ignorance.
2
20
749