Double Binary Tree Algorithm