## Snippets tagged tree

• ### sum the nodes in a (not-binary) tree using continuations

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 this

Posted: 13 years ago by Carsten König

• ### Tree using sequences

Tree implementation using sequences.

2 people like this

Posted: 13 years ago by Ankur Dhama

• ### EnumerateDirectoryFilesInfo

the function returns entire files sequence for given root directory, including sub-directories.

1 people like this

Posted: 11 years ago by Michael Gringauz

• ### Layout binary tree

Solution to the layout binary tree problem from 99 OCaml problems

3 people like this

Posted: 10 years ago by Darren Platt, Tomas Petricek

• ### Tree folding

How to fold a tree left branch first.

1 people like this

Posted: 8 years ago by krgn

• ### Type-a-head search tree for strings

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 this

Posted: 13 years ago by fholm

• ### Seq.reduceBallanced function

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 this

Posted: 12 years ago by Tomas Petricek

• ### Iterate B-Tree

Iterate simple b-tree

3 people like this

Posted: 11 years ago by devshorts

• ### Tree walker

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 this

Posted: 9 years ago by orlandow