This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.math.BigInteger; | |
| public class Fibonacci { | |
| private int fib1(int n) { | |
| if (n == 1 || n == 2) { | |
| return 1; | |
| } | |
| int r = fib1(n - 1) + fib1(n - 2); | |
| return r; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class BinarySearch { | |
| /** | |
| * Returns index of x if it is present in arr[start.. end] | |
| * @param arr | |
| * @param start | |
| * @param end | |
| * @param x | |
| * @return | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class AuthenticationToken extends AbstractAuthenticationToken { | |
| private String token; | |
| public AuthenticationToken(String token) { | |
| super(null); | |
| this.token = token; | |
| setAuthenticated(false); | |
| } |