the answer is 23 for this array
Type: Posts; User: mia_tech
the answer is 23 for this array
ok, I forgot that 25 is worst case scenario in which you need to compare all numbers, but here are the numbers I'm comparing. could you tell me what's the number of comparison you get
45 62 98 89...
so, how many comparison does it take using merge sort to sort an array of 10 numbers?... I got 26, what do you get?
by doing like you told me gives me only 12 comparison, and I know is more than...
I think you might be right ;0)
if you take a look at mergeSort method it has two recursive calls in it, so every time merge is called it reset i = 0, so you need some sort of class variable to keep track of total i's
yeah, that's exactly what I did... well, kind of, my mergeSorter is inside the while loop, in other words everytime loops is comparing, but yours is outsid the while loop, which gives a different...
guys, I have the following merge sort algorithm, and I'm trying to count the number of comparison that is has to do in order to sort the whole array. I know the formula, I just don't know where to...