Doubly linked list, binary tree, construction of Haverman tree