Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- temp_left=deepcopy(l)
- temp_left._next=None
- temp_left._prev=None
- temp_right=deepcopy(r)
- temp_right._next=None
- temp_right._prev=None
- newfront=False
- newrear=False
- if(l._prev is None):
- newfront=True
- if r._next is None:
- newrear=True
- if l._prev is not None:
- l._prev._next=temp_right
- temp_right._prev=l._prev
- l._next._prev=temp_right
- temp_right._next=l._next
- if r._next is not None:
- r._next._prev=temp_left
- temp_left._next=r._next
- r._prev._next=temp_left
- temp_left._prev=r._prev
- if newfront:
- self._front=temp_right
- if newrear:
- self._rear=temp_left
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement