Skip to content

Instantly share code, notes, and snippets.

View acodercat's full-sized avatar
🎯
Focusing

codercat acodercat

🎯
Focusing
  • Arizona State University
  • 21:22 (UTC +01:00)
  • LinkedIn in/maohaoran
View GitHub Profile
@Sciss
Sciss / binarytree.gvpr
Created June 6, 2012 00:04
GraphViz formatting script for binary trees
// 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;