Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. if(_head==null)
  2. return null;
  3.  
  4. if((p.equals(_head.getPoint())) && (getlength()==1)){//checks if the givvem point is the only point if does return a copy of the point.
  5. return _head.getPoint();
  6. }
  7.  
  8. PointNode t = _head;
  9. while(t.getNext()!= null){
  10. t=t.getNext();
  11. if(t.getNext() == null){
  12. if(p.equals(t.getPoint()))
  13. return new Point (_head.getPoint());
  14. }
  15. if (p.equals(t.getPoint()))
  16. return new Point (t.getNext().getPoint());
  17. }
  18. return null;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement