Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Otro

COS2611 assignment 2 project solution 2025

Puntuación
4.0
(1)
Vendido
3
Páginas
7
Subido en
21-07-2025
Escrito en
2024/2025

SPECIFICATIONS FOR THIS PROJECT 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) Utilize the implemented TWO sorting algorithms to sort these randomly generated arrays. d) Generate a report to indicate: - The input size (number of elements). - The execution time for the two different sorting algorithms. - The time complexity formulas for the two different sorting algorithms. Typical output:

Mostrar más Leer menos
Institución
Grado

Vista previa del contenido

COS2611 ASSIGNMENT 2 2025
Ready solutions




Either copy this code OR download from the link at the end of the file


SPECIFICATIONS FOR THIS PROJECT
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) Utilize the implemented TWO sorting algorithms to sort these randomly generated arrays.

d) Generate a report to indicate:
- The input size (number of elements).

- The execution time for the two different sorting algorithms.

- The time complexity formulas for the two different sorting algorithms.

, Output:




Source Code:

//Your student number
//Your name


#include <iostream>
#include <vector>
#include <ctime>
#include <cstdlib>
#include <iomanip>
#include <cmath>
//#include "COS2611_As2_P1.h"
using namespace std;


//Function for the first sorting algorithm
// Bubble Sort implementation
void bubbleSort(vector<int>& arr) {
int n = arr.size();
// Traverse through all array elements

Escuela, estudio y materia

Institución
Grado

Información del documento

Subido en
21 de julio de 2025
Número de páginas
7
Escrito en
2024/2025
Tipo
OTRO
Personaje
Desconocido

Temas

$6.25
Accede al documento completo:

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Reseñas de compradores verificados

Se muestran los comentarios
8 meses hace

4.0

1 reseñas

5
0
4
1
3
0
2
0
1
0
Reseñas confiables sobre Stuvia

Todas las reseñas las realizan usuarios reales de Stuvia después de compras verificadas.

Conoce al vendedor

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
CrystalIndigo University of South Africa (Unisa)
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
486
Miembro desde
5 año
Número de seguidores
226
Documentos
73
Última venta
5 meses hace
CrystalIndigo Solutions

providing all solutions to all computer science modules

4.1

51 reseñas

5
27
4
13
3
6
2
1
1
4

Documentos populares

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes