Element insertion

func insert_after(a,b) {
    b{:next} = a{:next}
    a{:next} = b
}
 
var B = Hash(
    data => 3,
    next => nil,    # not a circular list
)
var A = Hash(
    data => 1,
    next => B,
)
var C = Hash(
    data => 2,
)
 
insert_after(A, C)

Last updated