Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 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
Institution
Module

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

Written for

Institution
Module

Document information

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

Subjects

£4.25
Get access to the full document:

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

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)
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
5 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

Trending documents

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 revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight 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 smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions