Question: how to genrate control flow diagram for quick sort void quicksort(element list[], int left, int right). { int pivot, i, j; element temp; if (left

how to genrate control flow diagram for quick sort

void quicksort(element list[], int left, int right).

  1. { int pivot, i, j;
    1. element temp;
    2. if (left < right)
      1. { i = left; j = right+1;
  2. pivot = list[left].key;
  3. do
    1. { do i++; while (list[i].key < pivot);
    2. do j--; while (list[j].key > pivot);
  4. if (i < j) SWAP(list[i], list[j], temp);
  5. } while (i < j);
    1. SWAP(list[left], list[j], temp);
    2. quicksort(list, left, j-1);
    3. quicksort(list, j+1, right); } }

a) Generate a program flow graph based on the source code of QuickSort() function.

b) Generate a branch table for branch testing

c) Use the branch testing method to generate test cases for all predicate nodes of QuickSort( ) function.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!