key = string value = int | string | array | object array = a sequence of `values` object = key + value pairs node = value | array_node | object_node node_id = int ops: - search(node_id) -> value - get_child(node_id, child_id) -> value - get_child(node_id, key) -> value - get_child_count(node_id) -> int - get_key(node_id, child_id) -> key - append(node_id, value) -> node_id - set(node_id, key, value) -> node_id impl: - stored as an array of `node` indexed by `node_id` - search -> O(1) just direct access - `array` -> implemented as btree-like structure (values are node_ids) - `object` -> implemented as btree-like structure (values are key:node_ids) - get_child -> O(log(m)) where `m` is items in that tree, simple access - get_key -> same as get child - append -> insert into tree - set -> insert into tree