Skip to content

9 Sorting algorithms implemented on TypeScript. Measuring their time complexity

Notifications You must be signed in to change notification settings

kuromii5/Sorting_Algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sorting Algorithms and Complexity measuring on TypeScript

About this project

This is my second study project in A&DS course - Sorting algorithms. I've implemented many sorting algorithms and some test with increasing array size. The results of this test are then being exported in .tsv and then in .xlsx files. There of course a way to export results without .tsv, I'm just dumb

Sorting Algorithms included

  • Bubble Sort
  • Selection Sort
  • Insertion Sort
  • Merge Sort
  • Quick Sort (basic implementation)
  • Heap Sort
  • Shell Sort (3 variations)
  • Intro Sort (basic implementation)
  • Tim Sort (basic implementation)

Test function

The test function in main.ts measures the execution time of sorting for every sorting algorithm. The mechanism is simple - array being generated with one of the 4 functions:

  • createSorted
  • createNearlySorted
  • createReverseSorted
  • createRandom Then sorting algorithm being executed and function measures execution time. After all, it exports the results to .xlsx file.

Known Issues

The main issue is main.ts file, which can test only one sorting algorithm. You can fix it if you want, or change the function name every time. Also .tsv files are kinda useless in this implementation, but export doesn't work without them.

About

9 Sorting algorithms implemented on TypeScript. Measuring their time complexity

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published