Anonymous user
Associative array/Creation: Difference between revisions
→Binary tree
m (Moved to Basic learning cat) |
|||
Line 303:
===Binary tree===
A simple idiom to create a persistent binary tree mapping strings to integers:
let map = StringMap.empty;;
let map = List.fold_left (fun map (key, value) -> StringMap.add key value map)
|