Search:

Type: Posts; User: andreas90

Search: Search took 0.08 seconds.

  1. [SOLVED] Re: counting number of comparisons in merge sort

    Exactly, this is what I suggested you with the second code of post#2. Did you try it?
    In post#4 I only explained why you need to put the mergeCounter += i; statement after the while loop and not...
  2. [SOLVED] Re: counting number of comparisons in merge sort

    Cannot test the code right now but I think the problem with your code is that you add i to the counter in every iteration. See the following example:
    1st iteration: i = 1 , counter = 1;
    2nd...
  3. [SOLVED] Re: counting number of comparisons in merge sort

    Hello mia_tech!
    If I'm getting it right you are trying to count how many times executes the first while loop of merge. If you want to count it every time that merge is called you can have a local...
Results 1 to 3 of 3