This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{- Implementation of BST (binary search tree) | |
Script is absolutly free/libre, but with no guarantee. | |
Author: Ondrej Profant -} | |
import qualified Data.List | |
{- DEF data structure -} | |
data (Ord a, Eq a) => Tree a = Nil | Node (Tree a) a (Tree a) | |
deriving Show |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#get the current directory. from | |
#http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in | |
pushd . > /dev/null | |
DIR="${BASH_SOURCE[0]}"; | |
if ([ -h "${DIR}" ]) then | |
while([ -h "${DIR}" ]) do cd `dirname "$DIR"`; DIR=`readlink "${DIR}"`; done | |
fi | |
cd `dirname ${DIR}` > /dev/null | |
DIR=`pwd`; | |
popd > /dev/null |