Adding counter to count basic operations in tree to doubly linked list.