Skip to content

Instantly share code, notes, and snippets.

Avatar
👦

codercat acodercat

👦
View GitHub Profile
@Sciss
Sciss / binarytree.gvpr
Created Jun 6, 2012
GraphViz formatting script for binary trees
View binarytree.gvpr
// from Emden Gansner
// https://mailman.research.att.com/pipermail/graphviz-interest/2010q2/007101.html
// requires GraphViz 2.28.0 (fails with 2.26.3 at least)
BEGIN {
double tw[node_t]; // width of tree rooted at node
double nw[node_t]; // width of node
double xoff[node_t]; // x offset of root from left side of its tree
double sp = 36; // extra space between left and right subtrees
double wd, w, w1, w2;
double x, y, z;