A simple repository used to learn algorithms by coding them myself
Find a file
2018-10-05 23:43:33 -05:00
.idea Add insertion sort algorithm 2018-10-05 23:43:33 -05:00
gradle/wrapper Add merge sort algorithm 2018-10-05 02:20:16 -05:00
sorting Add insertion sort algorithm 2018-10-05 23:43:33 -05:00
build.gradle Add merge sort algorithm 2018-10-05 02:20:16 -05:00
gradlew Add merge sort algorithm 2018-10-05 02:20:16 -05:00
gradlew.bat Add merge sort algorithm 2018-10-05 02:20:16 -05:00
README.md Add insertion sort algorithm 2018-10-05 23:43:33 -05:00
settings.gradle Add merge sort algorithm 2018-10-05 02:20:16 -05:00

Algorithms

This repository is meant for me to compile a list of examples of different algorithms that I have learned of, and develop a working implementation. These implementations may not be the most efficient, so please do point it out to me if you see something that could be improved upon. The complexity notations were taken from the Big O Cheatsheet

Sorting

Algorithm Implementation Tests Worst Time Complexity Worst Space Complexity
Insertion Sort InsertionSort.java ParameterizedInsertionSortTest.java O(n²) O(1)
Merge Sort MergeSort.java ParameterizedMergeSortTest.java O(n log(n)) O(n)

Building/Testing

./gradlew test

To keep things simple, the tests share the same data where possible.