you can easily find how to use continuations to iterate over a binary tree but what if the count of children for each node is not known at design time? It's not so obvious how to do this in order to get a tail-recursive method. This short snippet shows how to do this to sum the values of every leaf. The second part demonstrates a general approach for other operations than addition.
26 people like thisPosted: 13 years ago by Carsten König
Tree implementation using sequences.
3 people like thisPosted: 13 years ago by Ankur Dhama
the function returns entire files sequence for given root directory, including sub-directories.
1 people like thisPosted: 11 years ago by Michael Gringauz
Solution to the layout binary tree problem from 99 OCaml problems
3 people like thisPosted: 10 years ago by Darren Platt, Tomas Petricek
How to fold a tree left branch first.
1 people like thisPosted: 8 years ago by krgn
This is a search tree for strings I've built for work to back fast type-a-head for AJAX forms, it could be made million times more space efficient but there was no real need for it so.
4 people like thisPosted: 13 years ago by fholm
The function has the same type as Seq.reduce. Instead of reducing elements from the left to the right, it splits the input into two halves, reduces each half separately and then aggregates the results using the given function. This means that the values are aggregated into a ballanced tree, which can save stack space.
2 people like thisPosted: 13 years ago by Tomas Petricek
Iterate simple b-tree
3 people like thisPosted: 11 years ago by devshorts
creates folder and file structure on the file system based on a tree output. Given a file generated from tree /f /a > file.txt it creates the structure on a given folder
3 people like thisPosted: 9 years ago by orlandow