Skip to content

Instantly share code, notes, and snippets.

View sheradmin's full-sized avatar
😃

Sherali Pirnafasov sheradmin

😃
View GitHub Profile
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;
public class BinarySearch {
/**
* Returns index of x if it is present in arr[start.. end]
* @param arr
* @param start
* @param end
* @param x
* @return
*/
@phuonghuynh
phuonghuynh / AuthenticationToken.java
Last active March 7, 2023 11:17
Spring Security - Multiple Authentication Providers
public class AuthenticationToken extends AbstractAuthenticationToken {
private String token;
public AuthenticationToken(String token) {
super(null);
this.token = token;
setAuthenticated(false);
}