Files
beyond-interviews/analysis/04-reverse-linked-list/diagrams/04_second_iteration.puml

38 lines
502 B
Plaintext

@startuml
title Step 4 — Second Iteration After Reversing Node 2
object "Node 1" as n1 {
value = 1
}
object "Node 2" as n2 {
value = 2
}
object "Node 3" as n3 {
value = 3
}
n2 --> n1 : next
n1 --> "null" : next
n3 --> "null" : next
object "previous" as prev
object "current" as cur
object "next" as nxt
prev --> n2
cur --> n3
nxt --> n3
note bottom
After processing Node 2:
2 -> 1 -> null
The reversed part grows from the front.
The remaining part starts at current.
end note
@enduml