Need assist with multi-stage bootloader...
Re: Need assist with multi-stage bootloader...
By George, I think he's got it! Lol! Yes, I did, thank God! If anyone ever has trouble with this and needs help, feel free to pm me. That was a real to hell and back ASM crash course. Onward to the kernel, Wentworth, march! lol... *Gets black stripe on his n00b not-quite-a-ninja white belt*
There are two major products that come out of Berkeley: LSD and UNIX. We don't believe this to be a coincidence. - Jeremy S. Anderson
- Owen
- Member
- Posts: 1700
- Joined: Fri Jun 13, 2008 3:21 pm
- Location: Cambridge, United Kingdom
- Contact:
Re: Need assist with multi-stage bootloader...
Quicksort's worst case conditions are pathological. Heapsort is always O(n log n), but in general runs slower. The best solution is something like STL does: if it determines it's going to run in horrid time, it switches from quicksort to heapsort.
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: Need assist with multi-stage bootloader...
Merge sort is typically considered to be faster than heapsort without sharing quicksort's worst case condition problem. The problem with merge sort is that it wastes a lot of memory unless you start consdering in-place merging - but that's when you start running into other problems. Introsort is a compromise between quicksort and heapsort where the algorithm will automatically switch to heapsort once the recursion depth is too big. Although quicksort is a stable sort, heapsort is not so you cannot guarantee that your sorting will be stable or not in advance. You can easily modify the algorithm so it will tell you. You can find more about introsort here.
EDIT: I usually use a modification of the introsort algorithm I've come up with where I use the smoothsort variation of heapsort. Since quicksort does part of the job and smoothsort comes closer to O(n) when the input is partially sorted, the results are considerably better.
EDIT: I usually use a modification of the introsort algorithm I've come up with where I use the smoothsort variation of heapsort. Since quicksort does part of the job and smoothsort comes closer to O(n) when the input is partially sorted, the results are considerably better.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]
Re: Need assist with multi-stage bootloader...
Thanks for the added information.
Combuster clarified this for me via PM, so as not to change the topic too much.
David
Combuster clarified this for me via PM, so as not to change the topic too much.
David
President of the Useless OS project