Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
3259944
Update BubbleSort.java
cganey Nov 23, 2019
9f76ad5
Update README.md
BryanChan777 Nov 23, 2019
862ac23
Merge pull request #1175 from BryanChan777/patch-1
yanglbme Dec 6, 2019
79d29c0
Comment revisions
Arogon1 Dec 11, 2019
b14cb96
Merge pull request #1182 from Arogon1/master
yanglbme Dec 11, 2019
d9c7b84
Merge pull request #1174 from cganey/BubbleSortLogic
yanglbme Dec 16, 2019
a6ae951
fix: removed warning for Sorts 'C-style array declaration of paramete…
valerydec17 Dec 30, 2019
01283e3
Merge pull request #1197 from valerydec17/master
yanglbme Dec 31, 2019
dc6f830
optimization
realDuYuanChao Jan 9, 2020
6f06de1
Create update_directory_md.yml
cclauss Jan 9, 2020
23874ff
updating DIRECTORY.md
Jan 9, 2020
fc4ec2c
Merge pull request #1201 from shellhub/dev
yanglbme Jan 10, 2020
0ff74ca
optimization
realDuYuanChao Jan 11, 2020
726aab9
Merge pull request #1202 from shellhub/dev
yanglbme Jan 11, 2020
be6b259
Fix bug
StepfenShawn Jan 26, 2020
79467b3
Added Best/First/Worst Fit algorithm implementation
DekasDimitrios Jan 26, 2020
d40464a
Change Done
DekasDimitrios Jan 26, 2020
6d50ec3
Merge pull request #1214 from DekasDimitrios/master
StepfenShawn Jan 26, 2020
3584990
Update update_directory_md.yml
cclauss Jan 27, 2020
e919997
updating DIRECTORY.md
Jan 27, 2020
4f45c5a
Fixing packages.
semsem-dev Jan 28, 2020
98ff29d
Merge pull request #1216 from Hassan-Elseoudy/master
nikhilkala Jan 28, 2020
a1f59c3
Closing scanners.
semsem-dev Jan 28, 2020
926ed2e
Merge pull request #1217 from Hassan-Elseoudy/master
nikhilkala Jan 28, 2020
d5ddc35
Simple Substitution Cipher Algorithm added.
semsem-dev Jan 28, 2020
e21d0ef
Update SimpleSubstitutionCipher.java
nikhilkala Jan 28, 2020
81612b4
Merge pull request #1218 from Hassan-Elseoudy/master
nikhilkala Jan 28, 2020
bf8845e
updating DIRECTORY.md
Jan 28, 2020
5aa05fd
Delete Dijkshtra.java
nikhilkala Jan 28, 2020
1f0f1a3
updating DIRECTORY.md
Jan 28, 2020
fcac632
Merge pull request #1219 from TheAlgorithms/nikhilkala-patch-1
nikhilkala Jan 28, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Conversions/DecimalToBinary.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/**
* This class converts a Decimal number to a Binary number
*
* @author Unknown
*
*/
class DecimalToBinary {

Expand Down
1 change: 1 addition & 0 deletions Conversions/DecimalToHexaDecimal.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package Conversions;

//hex = [0 - 9] -> [A - F]
class DecimalToHexaDecimal {
private static final int sizeOfIntInHalfBytes = 8;
private static final int numberOfBitsInAHalfByte = 4;
Expand Down
4 changes: 3 additions & 1 deletion Conversions/DecimalToOctal.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@
/**
* This class converts Decimal numbers to Octal Numbers
*
* @author Unknown
*
*/
public class DecimalToOctal {
/**
* Main Method
*
* @param args Command line Arguments
*/

//enter in a decimal value to get Octal output
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n, k, d, s = 0, c = 0;
Expand Down
4 changes: 3 additions & 1 deletion Conversions/HexaDecimalToBinary.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package Conversions;

//Hex [0-9],[A-F] -> Binary [0,1]

public class HexaDecimalToBinary {

private final int LONG_BITS = 8;
Expand All @@ -9,7 +11,7 @@ public void convert(String numHex) {
int conHex = Integer.parseInt(numHex, 16);
// Hex a Binary:
String binary = Integer.toBinaryString(conHex);
// Presentation:
// Output:
System.out.println(numHex + " = " + completeDigits(binary));
}

Expand Down
20 changes: 20 additions & 0 deletions Conversions/IntegerToRoman.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
package Conversions;

/**
* Converting Integers into Roman Numerals
*
*('I', 1);
*('IV',4);
*('V', 5);
*('IV',9);
*('X', 10);
*('XL',40;
*('L', 50);
*('XC',90);
*('C', 100);
*('D', 500);
*('M', 1000);
*
*/


public class IntegerToRoman {
private static int[] allArabianRomanNumbers = new int[]{1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1};
private static String[] allRomanNumbers = new String[]{"M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"};

//Value must be > 0

public static String integerToRoman(int num) {
if (num <= 0) {
return "";
Expand Down
1 change: 1 addition & 0 deletions Conversions/RomanToInteger.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class RomanToInteger {
put('D', 500);
put('M', 1000);
}};
//Roman Number = Roman Numerals

/**
* This function convert Roman number into Integer
Expand Down
2 changes: 1 addition & 1 deletion Maths/AbsoluteMax.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static void main(String[] args) {
}

/**
* get the value, it's absolute value is max
* get the value, return the absolute max value
*
* @param numbers contains elements
* @return the absolute max value
Expand Down
2 changes: 1 addition & 1 deletion Maths/AbsoluteMin.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static void main(String[] args) {
}

/**
* get the value, it's absolute value is min
* get the value, returns the absolute min value min
*
* @param numbers contains elements
* @return the absolute min value
Expand Down
9 changes: 6 additions & 3 deletions Maths/Factorial.java
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
package Maths;

//change around 'n' for different factorial results
public class Factorial {
public static void main(String[] args) {
int n = 5;
System.out.println(n + "! = " + factorial(n));
}

//Factorial = n! = n1 * (n-1) * (n-2)*...1

/**
* Calculate factorial
* Calculate factorial N
*
* @param n the number
* @return the factorial of {@code n}
*/
public static long factorial(int n) {
if (n < 0) {
throw new ArithmeticException("n < 0");
throw new ArithmeticException("n < 0"); //Dont work with less than 0
}
long fac = 1;
for (int i = 1; i <= n; ++i) {
fac *= i;
}
return fac;
return fac; //Return factorial
}
}
9 changes: 5 additions & 4 deletions Maths/Pow.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package maths;

//POWER (exponentials) Examples (a^b)
public class Pow {
public static void main(String[] args) {
assert pow(2, 0) == Math.pow(2, 0);
assert pow(0, 2) == Math.pow(0, 2);
assert pow(2, 10) == Math.pow(2, 10);
assert pow(10, 2) == Math.pow(10, 2);
assert pow(2, 0) == Math.pow(2, 0); // == 1
assert pow(0, 2) == Math.pow(0, 2); // == 0
assert pow(2, 10) == Math.pow(2, 10); // == 1024
assert pow(10, 2) == Math.pow(10, 2); // == 100
}

/**
Expand Down