All lessons

Linked Lists

8 min · OCaml examples

Chain nodes with next pointers — traverse, count, and update without shifting a whole array.

OCaml · Linked Lists0/5 cleared

Enemy 1 of 5

OCaml lists are already linked lists: each cell is a head value and a tail list.

Pattern match on Cons (head, tail) or Nil to walk and count nodes.

You
Binary Treant

Loading editor...

Ln 1, Col 1Spaces: 4
Sign up to fightTarget output: 3