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).
- { int pivot, i, j;
- element temp;
- if (left < right)
- { i = left; j = right+1;
- pivot = list[left].key;
- do
- { do i++; while (list[i].key < pivot);
- do j--; while (list[j].key > pivot);
- if (i < j) SWAP(list[i], list[j], temp);
- } while (i < j);
- SWAP(list[left], list[j], temp);
- quicksort(list, left, j-1);
- 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
Get step-by-step solutions from verified subject matter experts
