Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(_head==null)
- return null;
- if((p.equals(_head.getPoint())) && (getlength()==1)){//checks if the givvem point is the only point if does return a copy of the point.
- return _head.getPoint();
- }
- PointNode t = _head;
- while(t.getNext()!= null){
- t=t.getNext();
- if(t.getNext() == null){
- if(p.equals(t.getPoint()))
- return new Point (_head.getPoint());
- }
- if (p.equals(t.getPoint()))
- return new Point (t.getNext().getPoint());
- }
- return null;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement