Skip to content

Instantly share code, notes, and snippets.

@iestynpryce
iestynpryce / bst.sh
Created November 27, 2012 07:47
An implementation of a Binary Sort Tree in Bash. Object-like behaviour has been faked using eval. Remember that eval in shell scripting can be evil.
#!/bin/bash
#
# Binary search tree is of the form:
# 10
# / \
# / \
# 4 16
# / \ /
# 1 7 12
#