Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. def move_to_next(self):
  2. if self.curr.next == None:
  3. return
  4. else:
  5. self.curr.data = self.curr.next.data
  6. self.curr.next = self.curr.next.next
  7. self.curr.prev = self.curr.next.prev
  8.  
  9. def move_to_prev(self):
  10. if self.curr == None:
  11. return
  12. else:
  13. self.curr.data = self.curr.prev.data
  14. self.curr.next = self.curr.prev.next
  15. self.curr.prev = self.curr.prev.prev
  16.  
  17. def remove(self):
  18. if self.curr == None:
  19. return
  20. else:
  21. self.curr.data = self.curr.next.data
  22. self.curr.prev.next = self.curr.next
  23. self.curr.next.prev = self.curr.prev
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement