Question: ( 1 6 pts ) You are given a random array consisting of integers ( including positive, negative, and 0 ) , and each element
pts You are given a random array consisting of integers including positive, negative, and and each element may be repeated.
Note: for all the questions below, please use the iostream library only.
a pts Write a function bubbleSort to implement Bubble Sort to sort the array in descending order.
Function signature:
void bubbleSortint nums int
Example:
Input: nums
Expected realization: nums
b pts Write a function quickSort to implement Quick Sort to sort the array in descending order.
Function signature:
void quickSort int nums int
Example: see above.
c pts Write a function dedup Licate to remove the repeated integers from your sorted array and return the length of the updated array. Do not use extra memory space.
Function signature:
int deduplicateint nums int
Example:
Input: nums
Expected realization: nums
Output:
d pts What are the time and space complexity of each function that you realized above? Explain why.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
