Question: Need these pseudocode in c++ Please provide c++ pseudocodes! thank you 1 3 5 Heap Sort: Here is the pseudocode for Heap Sort, modified to

Need these pseudocode in c++

Need these pseudocode in c++ Please provide c++ pseudocodes! thank you 1

Please provide c++ pseudocodes! thank you

1 3 5 Heap Sort: Here is the pseudocode for Heap Sort, modified to include a counter: count - 0 HeapSort (A) 1 Build Max Heap (A) 2 for i-length [A] downto 2 do exchange A[1] -- A[1] heap-size[A] - heap-size [A] - 1 Max_Heapify(A, 1) And here is the algorithm for the Max_Heapify function used by Heap Sort: Max_Heapify (A, i) 1 1- LEFT (1) - RIGHT (1) 3 if is heap-size [A] and A[1] > A[i] then largest -1 else largest - i if I s heap-size[A] and A[r] > A[largest] then largest - if largest i then exchange A[i] - A[largest] 9.5 count - count + 1 Max_Heapify (A, largest) 2 And here is the algorithm for the Build_Max_Heap function used by Heap Sort: Build_Max_Heap (A) heap-size[A] - length [A] 2 for i - floor(length [A]/2) downto 1 do Max_Heapify (A, :) Your program for Heap Sort should have a line of code in it that is equivalent to line 10 in the Max_Heapify pseudocode above. In your program, a global counter should keep track of the number of times this line is executed. Quick Sort: Here is the pseudocode for Quick Sort, modified to include a counter QuickSort (A) i Count - 0 2 QUICKSORT (A, 1, length [A]) Here is the pseudocode for the QUICKSORT function used by Quick Sort: QUICKSORT (A,D,I) 1 if p

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!