rotate image
flatten binary tree to linked list