c) O(n2)d) O(n3)112.In average case Heap sort is as efficient as the Quick sort.
Get answer to your question and much more
113.Choose the correct option to fill? X so that the code given belowimplements the Heap sort.#include<stdio.h>voidheapify(intarr[],intn,inti){intlargest=i;// Initialize largest as rootintl=2*i+1;// left = 2*i + 1intr=2*i+2;// right = 2*i + 2if(l<n&&arr[l]>arr[largest])largest=l;if(r<n&&arr[r]>arr[largest])largest=r;if(largest!=i){swap(arr[i], arr[largest]);heapify(arr, n, largest);}}voidheapSort(intarr[],intn){for(inti=n/2-1;i>=0;i--)heapify(arr, n, i);for(inti=n-1;i>=0;i--){X;heapify(arr, i,0);}}voidprintArray(intarr[],intn){for(inti=0;i<n;++i)printf(“%d”,arr[i]);printf(“\n”);}intmain(){intarr[]={12,11,13,5,6,7};intn=sizeof(arr)/sizeof(arr[0]);heapSort(arr, n);printf(“Sorted array is \n");printArray(arr, n);}a) swap(arr[0], arr[n])b) swap(arr[i], arr[n])