Advertisement
Guest User

Untitled

a guest
Sep 30th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. public int positionOfLastFiveFromEnd () {
  2. return positionOfLastFiveFromEndHelper (first);
  3. }
  4. private static int positionOfLastFiveFromEndHelper(Node i) {
  5. if (i == null) return -1;
  6. int result = positionOfLastFiveFromEndHelper(i.next);
  7. result = result -1;
  8. if (i.item == 5)
  9. //ans = ans +1;
  10. //return ans;
  11. return result;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement