Implemented n-ary and binary trees