aeongt710/dotnet-roadmap

Problem Statement: Analyze and Compare Sorting Algorithms

Closed this issue · 4 comments

Objective

Create a C# console application that performs both synchronous and asynchronous sorting operations on arrays of integers. The goal is to compare the execution times of different sorting algorithms when run synchronously and asynchronously.

Requirements

Synchronous Operation

  • Implement at least two sorting algorithms (e.g., Bubble Sort and Quick Sort) that sort an array of integers synchronously.
  • Measure and display the time taken for each algorithm to sort the array.

Asynchronous Operation

  • Implement the same sorting algorithms but make them run asynchronously.
  • Measure and display the time taken for each algorithm to sort the array.

Comparison

  • After both synchronous and asynchronous operations are complete, display a comparison of the time taken for each sorting algorithm and each operation type (sync vs async).

Array Generation

  • Generate arrays of integers for sorting. The arrays should be of substantial size to make the sorting operation time noticeable (e.g., an array with 10,000 elements).

Expected Output

  • The number of elements in the sorted array.
  • The time taken to sort the array for each algorithm and operation type (sync and async).

Constraints

  • Use the System.Diagnostics.Stopwatch class for time measurement.
  • Do not use any third-party libraries for sorting; implement the algorithms from scratch.

Evaluation

You will be evaluated on:

  • The efficiency of your sorting algorithms
  • The proper implementation of synchronous and asynchronous operations
  • The accuracy of your time measurements.