Skip to content

Commit a5de4ba

Browse files
committed
change Structure
1 parent 9959e9e commit a5de4ba

21 files changed

Lines changed: 50 additions & 387 deletions

File tree

File renamed without changes.

Java/FastFourierTransform/FFT.java

Lines changed: 0 additions & 144 deletions
This file was deleted.

Java/Fibonacci/Fibonacci.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,24 @@ public static void main(String[] args) {
1414
}
1515

1616
}
17+
18+
public static void fibonacciRecursionv1(int count, int a, int b) {
19+
if (count > 0) {
20+
int c = a + b;
21+
a = b;
22+
b = c;
23+
System.out.printf("%d ", c);
24+
fibonacciRecursionv1(count - 1, a, b);
25+
}
26+
}
27+
28+
public static int fibonacciRecursionv2(int i){
29+
if(i==1 || i==2){
30+
return 1;
31+
}
32+
else if (i == 0){
33+
return 0;
34+
}
35+
return fibonacciRecursionv2(i-2)+fibonacciRecursionv2(i-1);
36+
}
1737
}

Java/Fibonacci/FibonacciRecursion.java

Lines changed: 0 additions & 19 deletions
This file was deleted.

Java/Fibonacci/FibonacciRecursive.java

Lines changed: 0 additions & 13 deletions
This file was deleted.

Java/Fibonacci/RecursiveFibonacci.java

Lines changed: 0 additions & 23 deletions
This file was deleted.

Java/Fisher Yates Shuffle/FisherYatesShuffle.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,8 @@
11
import java.util.Arrays;
22
import java.util.Random;
33

4-
/**
5-
* Fisher–Yates shuffle algorithm.
6-
*
7-
* @author Atom
8-
*
9-
*/
104
public class FisherYatesShuffle {
115

12-
/**
13-
* Modern version (Richard Durstenfeld) of the Fisher–Yates shuffle algorithm.
14-
*
15-
* @param arr generic array
16-
* @see <a href="https://en.wikipedia.org/wiki/Fisher-Yates_shuffle">Fisher–Yates shuffle</a>
17-
*/
186
public static <T> void shuffle(T[] arr) {
197
Random rnd = new Random();
208
for (int i = arr.length - 1; i > 0; i--) {

Java/Floyds Algorithm/Floyds_algorithm.java renamed to Java/Floyds Algorithm/AllPairShortestPath.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
// A Java program for Floyd Warshall All Pairs Shortest
22
// Path algorithm.
3-
import java.util.*;
43
import java.lang.*;
5-
import java.io.*;
64

75

8-
class AllPairShortestPath
6+
public class AllPairShortestPath
97
{
108
final static int INF = 99999, V = 4;
119

Java/Greatest Common Divisor/EuclideanGCD.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
/**
2-
* Calculates the greatest common divisor of two natural numbers.
3-
*
4-
* @author Atom
5-
*
6-
*/
1+
2+
73
public class EuclideanGCD {
84

95
/**

Java/Greatest Common Divisor/GCD.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class GCD {
1+
public class GCD {
22
public static int gcd(int a, int b) {
33
int temp, remainder;
44
// The larger value will always be assigned to the int a.

0 commit comments

Comments
 (0)