SOLUTION(100% working)
Crystal Indigo!
Crystal Indigo!
Providing all solutions you need anytime
+27 76 626 8187
Copy and run the code and submit what you are suppose to submit
, Question 16
You are required to choose two sorting algorithms from a specified list the first algorithm must be
Bubble Sort, while the second algorithm can be either Merge Sort or Heap Sort.
a) Write a C++ program where you implement the two sorting algorithms you have chosen -ensure
that they are part of the same program and can be called using methods, functions and/or
procedures.
b) Continue in this C++ program and generate random input arrays of different sizes specifically
100, 1000, and 5000 elements.
c) Utlize the implemented TWO sorting algorithms to sort these randomly generated arrays.
d) Generate a report to indicate:
1 The input size (number of elements).
2 The execution time for the two different sorting algorithms.
3 The time complexity formulas for the two different sorting algorithms
Typical output:
Input Size: 100
XXXX Sort: Execution Time: 0.002 seconds
YYYYY Sort: Execution Time: 0.001 seconds
Input Size: 1000
1O00 sort: Execution Time: 0.05 seconds
YYYYYSort: Execution Time: 0.01 seconds
Input Size: 5000
XXXX Sort: Execution Time: 2.5 seconds
YYYYY Sort: Execution Time: 0.1 seconds
The time complexity formula for XXXX: Give the fornula
The time complexity formula for YYYYY: Give the formula
OUTPUT