Popular recipes by Chris Ecker http://code.activestate.com/recipes/users/4180203/2015-01-13T22:56:53-08:00ActiveState Code RecipesHighly branched Trees (Python)
2014-05-14T19:16:04-07:00Chris Eckerhttp://code.activestate.com/recipes/users/4180203/http://code.activestate.com/recipes/578879-highly-branched-trees/
<p style="color: grey">
Python
recipe 578879
by <a href="/recipes/users/4180203/">Chris Ecker</a>
(<a href="/recipes/tags/tree/">tree</a>).
Revision 2.
</p>
<p>Trees are very common data structures and are usually considered to be very efficient. However, this is only true if the tree is balanced, meaning that all branches have roughly the same number of nodes. </p>
<p>There are good balancing trees, such as rb-trees or avl-trees. Unfortunately they are quite difficult to implement. An alternative tree structure is the highly branched b-tree (<a href="https://en.wikipedia.org/wiki/B-tree" rel="nofollow">https://en.wikipedia.org/wiki/B-tree</a>). In the c language, binary trees are preferable in most cases. However, in python things are different. This recipe shows how simple it is to implement a b-tree in python. The example is a sorted dict.</p>
Text Model (Python)
2015-01-13T22:56:53-08:00Chris Eckerhttp://code.activestate.com/recipes/users/4180203/http://code.activestate.com/recipes/577978-text-model/
<p style="color: grey">
Python
recipe 577978
by <a href="/recipes/users/4180203/">Chris Ecker</a>
(<a href="/recipes/tags/datastuctures/">datastuctures</a>, <a href="/recipes/tags/text_processing/">text_processing</a>, <a href="/recipes/tags/tree/">tree</a>).
Revision 3.
</p>
<p>A tree data type holding text data together with styling information. </p>