One implementation of the LIST ADT - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

One implementation of the LIST ADT

Description:

Doubly linked list. head. current. Insert new node before current. and new node becomes current ... Doubly linked list. head. current. newNode- prev=current ... – PowerPoint PPT presentation

Number of Views:33
Avg rating:3.0/5.0
Slides: 14
Provided by: moy57
Category:

less

Transcript and Presenter's Notes

Title: One implementation of the LIST ADT


1
One implementation of the LIST ADT
head
current
Insert new node before current and new node
becomes current (assume new node created) node
newNode new node
2
One implementation of the LIST ADT
head
current
prev
prev head while (prev-gtnext ! current) prev
prev-gtnext
3
One implementation of the LIST ADT
head
current
prev
prev head while (prev-gtnext ! current) prev
prev-gtnext
4
One implementation of the LIST ADT
head
current
prev
newNode
node newNode new node prev-gtnext newNode
5
One implementation of the LIST ADT
head
current
prev
newNode
node newNode new node prev-gtnext
newNode newNode-gtnext current
6
One implementation of the LIST ADT
head
prev
current
newNode
node newNode new node prev-gtnext
newNode newNode-gtnext current current
newNode
7
One more implementation of the LIST ADT
Circular single linked list
tail
Start function. current tail-gtlink
8
One more implementation of the LIST ADT
Doubly linked list
head
current
Insert new node before current and new node
becomes current (assume new node created) node
newNode new node
9
One more implementation of the LIST ADT
Doubly linked list
head
current
newNode
newNode-gtprevcurrent-gtprev
10
One more implementation of the LIST ADT
Doubly linked list
head
current
newNode
newNode-gtprevcurrent-gtprev newNode-gtnextcurrent

11
One more implementation of the LIST ADT
Doubly linked list
head
current
newNode
newNode-gtprevcurrent-gtprev newNode-gtnextcurrent
newNode-gtprev-gtnext newNode
12
One more implementation of the LIST ADT
Doubly linked list
head
current
newNode
newNode-gtprevcurrent-gtprev newNode-gtnextcurrent
newNode-gtprev-gtnext newNode current-gtprev
newNode
13
One more implementation of the LIST ADT
Doubly linked list
head
current
newNode
newNode-gtprevcurrent-gtprev newNode-gtnextcurrent
newNode-gtprev-gtnext newNode current-gtprev
newNode current newNode
Write a Comment
User Comments (0)
About PowerShow.com