100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Other

COS2611 Assignment 2 Question 16 code

Rating
-
Sold
2
Pages
5
Uploaded on
05-07-2024
Written in
2023/2024

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

Show more Read less









Whoops! We can’t load your doc right now. Try again or contact support.

Document information

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

Subjects

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

Get to know the seller

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 University of South Africa (Unisa)
View profile
Follow You need to be logged in order to follow users or courses
Sold
486
Member since
5 year
Number of followers
226
Documents
73
Last sold
2 months ago
CrystalIndigo Solutions

providing all solutions to all computer science modules

4,1

51 reviews

5
27
4
13
3
6
2
1
1
4

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

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

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

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

Student with book image

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

Alisha Student

Frequently asked questions