Earlier quoted context omitted.
a double-ended queue is often implemented using a doubly linked list (like the one in use here) if you back it by two arrays then you can't do O(1) inserts in the middle (like is going on here)
It's true that awful Deque implementations are often built from a linked list. If you're taught about big-O notation and haven't noticed how modern computers work you might even do that today. I would expect that they're thinking of something more like Rust's VecDeque, so that's a conventional "growable array" (Rust's Vec, Java ArrayList, C++ std::vector) used internally with some head + tail tracking to form a circu…
JesseSort: A novel sorting algorithm that is faster than Python's default sort.
31–40 of 65 posts
Re: JesseSort: A novel sorting algorithm that is faster than Python's default sort.
#32Re: JesseSort: A novel sorting algorithm that is faster than Python's default sort.
#33So the idea is that you'll eventually arrange n elements into ideally about √n sorted lists, organized so that the endpoints of these lists are also ordered (the "rainbow" shape). A new element goes on the end of one of those lists or a new list; which one is generally decided by binary search, but the index is saved to speed up the next insertion if it's the same. So a natural run might benefit by having adjacenct v…
Re: JesseSort: A novel sorting algorithm that is faster than Python's default sort.
#34Re: JesseSort: A novel sorting algorithm that is faster than Python's default sort.
#35"We find that for smaller n≲ 262144, JesseSort is slower than Python’s default sort."
What about the median? Two elements to sort? One? Zero again?
Re: JesseSort: A novel sorting algorithm that is faster than Python's default sort.
#36I have mixed feelings about the naming. Isn't it kinda off-putting that he named it after himself? usually it's other people who name your algorithm after you. At least that's how it's like in science and engineering (Fourier didn't call it "Fourier transform", Laplace didn't call it "Laplace transform", Kalman didn't name it "Kalman filters", etc.)
Re: JesseSort: A novel sorting algorithm that is faster than Python's default sort.
#37I know it is not possible in our Universe but on a lighter note, in some parallel universe out there, someone has made a sorting algorithm that runs in O(1). I wonder though if a quantum computer can simultaneously sort all the elements in O(1)
Re: JesseSort: A novel sorting algorithm that is faster than Python's default sort.
#38I have mixed feelings about the naming. Isn't it kinda off-putting that he named it after himself? usually it's other people who name your algorithm after you. At least that's how it's like in science and engineering (Fourier didn't call it "Fourier transform", Laplace didn't call it "Laplace transform", Kalman didn't name it "Kalman filters", etc.)
He should have at least called it eejss-sort
Re: JesseSort: A novel sorting algorithm that is faster than Python's default sort.
#39"We find that for smaller n≲ 262144, JesseSort is slower than Python’s default sort."
I wonder about the global statistics of sorted data... Is the most common number of elements to sort zero? Certainly less than ten? What about the median? Two elements to sort? One? Zero again?