(flatten-tree adjacency-list node)Returns a depth-first traversal of the tree. Where :start and :end represents the start or end of a node's exploration.
adjacency-list: map => { parent-node [child child ...], ... }. node: this node will be explored using depth first search.
(flatten-tree {1 [2 3] 2 [4] 3 [5]} 1)
=> [[1 :start 0] [2 :start 1] [4 :start 2] [4 :end 2] [2 :end 1] [3 :start 1] [5 :start 2] [5 :end 2] [3 :end 1] [1 :end 0]]
[node start/end depth] node: unique index of each node. start/end: [[node1 :start] ... [node1 :end]] everything in between are children of node1 depth: depth of node in the tree
Returns a depth-first traversal of the tree. Where :start and :end represents
the start or end of a node's exploration.
adjacency-list: map => { parent-node [child child ...], ... }.
node: this node will be explored using depth first search.
(flatten-tree
{1 [2 3]
2 [4]
3 [5]}
1)
=> [[1 :start 0]
[2 :start 1]
[4 :start 2]
[4 :end 2]
[2 :end 1]
[3 :start 1]
[5 :start 2]
[5 :end 2]
[3 :end 1]
[1 :end 0]]
[node start/end depth]
node: unique index of each node.
start/end:
[[node1 :start] ... [node1 :end]]
everything in between are children of node1
depth: depth of node in the tree
(format-values record opts exploration)fn-args and fn-rv might contain strings with escape sequences such as
.
They need to be properly escaped, else the output spans to multiple lines.
`fn-args` and `fn-rv` might contain strings with escape sequences such as . They need to be properly escaped, else the output spans to multiple lines.
(get-indicator depth indent marker exploration)Returns Г-- L-- | Г-- | L-- --> -->
Returns Г-- L-- | Г-- | L-- --> -->
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |