Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/augustdanell/algorithms
Here I put up implementations of Sorting Algorithms, Dynamic programming, etc. Algorithms that can be useful to have.
https://github.com/augustdanell/algorithms
algorithms brute-force dynamic-programming greedy greedy-algorithms sorting-algorithms
Last synced: 15 days ago
JSON representation
Here I put up implementations of Sorting Algorithms, Dynamic programming, etc. Algorithms that can be useful to have.
- Host: GitHub
- URL: https://github.com/augustdanell/algorithms
- Owner: AugustDanell
- Created: 2021-06-30T11:57:49.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-08-24T04:01:45.000Z (over 3 years ago)
- Last Synced: 2024-11-06T03:11:41.446Z (2 months ago)
- Topics: algorithms, brute-force, dynamic-programming, greedy, greedy-algorithms, sorting-algorithms
- Language: Python
- Homepage:
- Size: 3.94 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Algorithms
In this repo I write different algorithms that I have learned both as a hub for myself as well as for any employers to see what I know how to implement. This includes sorting algortihms, like quicksort, mergesort, insertion sort etc. I also write programs based on dynamic programming where for instance we have the exponential growth of the fibonacci numbers, in a top down approach. In my tests I test the different times of a bottum up versus a top down and memoized version. Overall I have been working in the following folders:- Sorting Algorithms
- Shuffling Algorithms
- Dynamic programming
- Recursions## Shuffling & Sorting Algorithms
One of the biggest subfolders in this repository pertains to sorting algortithms. Here I have implemented a myriad of different sorting algortihms including a generalized quicksorting algorithm that takes as argument a function for which to select a pivot. The sorting algorithms are tested using a sorted list and its copied value unto another list. We shuffle the copied list around using Fisher-Yates Shuffling algorithm implemented in "shuffling algortihms", and we make assertions that the sorted list has to be equal to the list where a sorting algortihm was applied for each time a sorting algortihm runs. I have implemented different sorting algortihms from a stupid permutation_sort to a generalized quicksort where each one works though some sorting algorithms are simply much better.As of right now the quicksort works well if the first element is selected as pivot, that is if we feed first_element_pivot() as an argument, for other pivot selection functions it doesn't work right now. The problem of course with selecting the first element is for instance a reversed list, we want to find a pivot somewhere in the middle but in a reversed list we will always get "extreme" elements. I have implemented a quicksort in Java in my programming DD1337 course where we took 3 elements and took the median of those three, and that selection method increased the time in which the sorting was made by quite a lot, and so I will make that work here as well.
## Dynamic Programming
Dynamic programming entails that we are making use of the way a problem can be broken up into overlapping subproblems. The fibonacci implementations are an example of that but there are others such as the Levenstein Distance etc, that is the smallest editing distance between two words W1, W2. This programming technique allows us to reduce the time complexity of problems from exponential time down to linear time sometimes, or atleast polynomial time. The Levenstein Distance, like fibonacci, are examples of how one can make that reduction in time complexity from brute force to dynamic programming.## Recursions
Here I have only been playing with basic recursive algorithms, not done anything interesting really.