Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static boolean isReachable(int id0, int id1, int d) {
- if(d == 0) return false;
- if(checkFriendship (id0,id1) == true) return true;
- for(int i = 0; i < currUsers; i++){
- if(checkFriendship(id0,i)==true){
- isReachable(i,id1,d-1);
- }
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment