Skip to content

Commit b1ed95f

Browse files
committed
First commit
1 parent 4d22cc2 commit b1ed95f

2 files changed

Lines changed: 44 additions & 1 deletion

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package com.prahalad.stanford;
2+
3+
/**
4+
* Fibonacci
5+
*
6+
*/
7+
public class Fibo
8+
{
9+
public static void main( String[] args )
10+
{
11+
12+
System.out.println(fibos(3));
13+
14+
15+
16+
}
17+
18+
19+
public static int fibos(int num){
20+
21+
22+
23+
if( num == 0){ return 0;}
24+
if( num == 1) { return 1; }
25+
26+
int temp = fibos(num-1) + fibos(num-2) ;
27+
28+
29+
return temp;
30+
31+
}
32+
33+
34+
35+
36+
public static int fact(int num){
37+
38+
if(num==1) return 1;
39+
else return fact(num-1) + fact (num-1);
40+
41+
42+
}
43+
}

StanfordAlgo/src/main/java/com/prahalad/stanford/KaratsubaMult.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class KaratsubaMult {
1515

1616
public int katMult(Integer a1, Integer b1){
1717

18-
18+
1919
aStr = a1.toString();
2020
bStr = b1.toString();
2121

0 commit comments

Comments
 (0)