We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I understand how the merge sort work....but my mind can't get the line "shifts += ni - i".....I can't understand this line counts the shifts....if anyone is generous enough to explain it would be appreaciated.
Insertion Sort Advanced Analysis
You are viewing a single comment's thread. Return to all comments →
I understand how the merge sort work....but my mind can't get the line "shifts += ni - i".....I can't understand this line counts the shifts....if anyone is generous enough to explain it would be appreaciated.