can anyone say at which point it is preferable to use InsertionSort instead of MergeSort.
I don't mean at array size but at how much of the array is already sorted
Are you building like a hybrid sort? Or does it sort, then add some data and sort again?
>>If in the latter case, are there possible lower val's ? or will all the new data be higher than the last sorted Value? (assuming it must make some difference..?)
Name:
n3n7i2011-09-11 22:25
Ooh, what about a Burst-blank-insert// for all values less than the highest last sorted value?
...might Require n- extra memory / array items? (where n = No of values < H. L. S)
Name:
Anonymous2011-09-11 22:30
it is a hybrid, a mergesort that uses insertionsort in less than 16 elements or 98% sorted (this info is either given or got by monte carlo)
Name:
Anonymous2011-09-11 22:35
i'd use some variant of strandsort in the bigger picture didn't need arrays, it's a pretty sweet disjoint sets implementation with 3n cost on linearly distributed data, this sorting just fucks me over
if you have a sorter array, why don't you simple use binary search to find place of new elements and insert them?
Name:
Anonymous2011-09-12 16:20
>>12 Quicksort does/uses swaps... But if you have Blanks you only need to do half a swap?
Not all swaps are created equals. Some languages can do it more efficiently than others.
Name:
Anonymous2011-09-12 16:22
>>14
Wow, you hold a Ph.D. in computer science, and yet, you made what has to be freshmen levelish mistake regarding swap? Wow. Wtf? Did you get your Ph.D at some loser school like San Diego State?
>>23
My first exposure to paging was at Ticketmaster. The idea was, to give users enough memory. I got the term "virtual memory" in my head and used it (wrongly) even when not swapping to disk. That's just "paging". In general, personally, I'm not good with standard terminology and sloppily use the first word that pops in my head instead of doing research to find what everybody else calls it.
God says...
Line: 12768
6:22 And the LORD spake unto Moses, saying, 6:23 Speak unto Aaron and
unto his sons, saying, On this wise ye shall bless the children of
Israel, saying unto them, 6:24 The LORD bless thee, and keep thee:
6:25 The LORD make his face shine upon thee, and be gracious unto
thee: 6:26 The LORD lift up his countenance upon thee, and give thee
peace.
6:27 And they shall put my name upon the children of Israel, and I
will bless them.
Name:
n3n7i2011-09-12 22:46
You can all make ID's now... if you like?
Everyone seems to be preoccupied with my five alphanumerics anyway...
Did that sort not work// Or you just didn't follow it (Didn't exactly explain very well eh)?
Question, did you actually need to resort data or nope?
Might be good for a variant of your problem>?
The rule of thumb for guessing how long asm code would take was to count memory referrences. That's no longer practical. When I made LoseThos not use paging, I thought, "If I get rid of 3 levels of indirection, it should be much faster!" CPU's do a good job of eliminating the penalty for all the indirection present in paging. Long mode (64-bit mode) requires paging. I identity map. The founding principle was all-ring-0 and no paging or at least identity-mapping. Both those boost performance (marginally).
They make pointless Linux wannabes. The ONLY ISSUE in OSDEV for PCs is compatibility. You're delusional if you think people will write drivers for you.