• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 5 pages
Other

COS2611 Assignment 2 Question 16 code

Document preview thumbnail
Preview 2 out of 5 pages

COS2611 Assignment 2 Question 16 code: 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

Content preview

COS2611 2024 ASSIGNMENT Q16
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

Document information

Uploaded on
July 5, 2024
Number of pages
5
Written in
2023/2024
Type
Other
Person
Unknown
$5.83

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
CrystalIndigo
4.1
(53)
Sold
491
Followers
226
Items
73
Last sold
1 month ago

Reviews from verified buyers




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions