MyriadColors
Explore posts from servers❔ Weird performance behavior with sorting algorithms.
Do what? Merge? I would see if there si any values in B that belongs in between min(A) and Max(A), fi so I would try to find where exactly that value would fit. If there isn´t, i would need to see if A comes after or before B.
48 replies
❔ Weird performance behavior with sorting algorithms.
So let me try to abstract the details right now:
Say I wish to merge and sort two lists:
A = [1,2,3]
and
B = [4,5,6]
If I take A[0] and B[0], then the merged list would start with [1,4] and so on until i ave the completed merged list.
But if i understand what you mean, you want me to see if A is already ordered, and see if it comes before or after B. So I would just merge them like M = [A,B] instead of "manually" sorting the two arrays into M.
48 replies