Guest User

isReachable

a guest
Nov 17th, 2013
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. public static boolean isReachable(int id0, int id1, int d) {
  2. if(d == 0) return false;
  3. if(checkFriendship (id0,id1) == true) return true;
  4. for(int i = 0; i < currUsers; i++){
  5. if(checkFriendship(id0,i)==true){
  6. isReachable(i,id1,d-1);
  7. }
  8. }
  9. return false;
  10. }
Advertisement
Add Comment
Please, Sign In to add comment