AD Tree implementation