40 lines
463 B
Plaintext
40 lines
463 B
Plaintext
@startuml
|
|
title Step 3 — Move previous and current
|
|
|
|
object "Node 1" as n1 {
|
|
value = 1
|
|
}
|
|
|
|
object "Node 2" as n2 {
|
|
value = 2
|
|
}
|
|
|
|
object "Node 3" as n3 {
|
|
value = 3
|
|
}
|
|
|
|
n1 --> "null" : next
|
|
n2 --> n3 : next
|
|
n3 --> "null" : next
|
|
|
|
object "previous" as prev
|
|
object "current" as cur
|
|
|
|
prev --> n1
|
|
cur --> n2
|
|
|
|
note right
|
|
previous = current
|
|
current = next
|
|
|
|
The reversed part is now:
|
|
|
|
1 -> null
|
|
|
|
The remaining original part is still:
|
|
|
|
2 -> 3 -> null
|
|
end note
|
|
|
|
@enduml
|