This repository is for implementing as many different algorithms in as many different programming languages as I can in order to understand to some degree both the computer algorithm as well as the computer language.
Each implementation directory will follow the naming convention Algorithm_Language
Algorithm Purpose: Efficient algorithm for sorting lists
Compiler / interpreter Detail: SWI-Prolog version 6.6.4 for amd64
Running Instructions:
- Run the SWI interpreter with the command "swipl"
- Load mergesort.pl with the input "[mergesort]."
- Input a list to sort followed by a variable to hold the result e.g. "mergesort([5,10,1,6,3], R)."
Algorithm Purpose: For two numbers, finds the largest number which divides both number with no remainder (i.e. the greatest common denominator: GCD)
Compiler / interpreter Detail: gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
Running Instructions:
- Compile: "gcc gcd.c -o gcd"
- Run using two numbers e.g. in linux "./gcd 42 105"
Algorithm Purpose: Another efficient algorithm for sorting lists
Compiler / interpreter detail: Java 10, Java SE Runtime Environment 18.3 (build 10+46) (Windows 10 Pro)
Running Instructions:
- Compile: "javac quicksort.java"
- Run the program and input a list to sort e.g. "java quicksort 5 3 4 19 3"
- (optional) Run the program with a randomly generated array e.g. "java quicksort random 100 100" where the first value is the length of the array and the second value is the maximum element value
Algorithm Purpose: An efficient algorithm for finding the median of two sorted lists of arbitrary size
Compiler / interpreter detail: ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux]
Running Instructions:
- Ensure you have the Ruby interpreter installed and available
- Run the find_median.rb ruby script ( in linux: "./find_median.rb" )