Skip to content

Implementation of sorting algorithms from CLRS

Notifications You must be signed in to change notification settings

hezbranch/Sorting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

Sorting

Implementation of sorting algorithms from Introduction to Algorithms (CLRS)

Cormen, T. H., Leiserson, C. E., Rivest, R. L., & Stein, C. (2009). Introduction to algorithms. MIT press.

Getting Started

Command line tutorial for Insertion Sort:

>>> from InsertionSort import *
>>> unsorted = [1, 5, 3, -1, 0, 9, 12]
>>> test = InsertionSort(unsorted)
>>> test.sort()
[-1, 0, 1, 3, 5, 9, 12]
>>> test.swap(2, 4)
[-1, 0, 5, 3, 1, 9, 12]
>>> test.sort()
[-1, 0, 1, 3, 5, 9, 12]
>>> test.time_it()
0.000028849 seconds

Next Steps

Hoping to add MergeSort, Quicksort, and a brief discussion on best use-cases.

Optimistically, an example of a quantum sorting algorithm (for space complexity analysis).

About

Implementation of sorting algorithms from CLRS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages