Given a binary tree, write an algorithm to return the right-side view and bottom-side view of the tree nodes.
Represent the tree as a level-indexed array: the children of the node at index i are at 2*i + 1 and 2*i + 2; null represents a missing node. Return [right_view, bottom_view]. The right-side view contains the visible node at each depth from the right. The bottom-side view reports the selected visible node for each horizontal position, from left to right, excluding the root's position; for equal positions, prefer the shallower node.
def tree_views(tree):