Convert array to binary tree and vice versa using level order traversal like LeetCode. Useful for testing LeetCode solutions.