Professional Documents
Culture Documents
Doubly Linked List
Doubly Linked List
INFO
RPTR
R
6
LPTR
L=R=NEW
RPTR
L
5
NEW
R
6
NEW
X
NEW
L
5
R
6
7
M
R
6
7
M
X
NEW
L
5
R
6
7
M
L=R
5
else
If OLD = L
(Left-most node being deleted)
then
L RPTR(L)
LPTR(L) NULL
else
L
5
If OLD = R
(Right-most node being deleted)
then
R LPTR(R)
RPTR(R) NULL
else
RPTR (LPTR(OLD)) RPTR (OLD)
LPTR (RPTR(OLD)) LPTR (OLD)
6
L
6
R
9
R
else If OLD = R
(Right-most node being deleted)
then R LPTR(R)
RPTR(R) NULL
else
L
5
R
6
R
7
L
5
If OLD = R
(Right-most node being deleted)
then
R LPTR(R)
RPTR(R) NULL
else
L
5
R
9
L
5
1
R
Questions?