[JavaScript] Fast and optimized iterative approach
\nvar sortedArrayToBST = function(nums) {\n    if (nums.length === 0) return undefined\n    \n    const root = new TreeNode(0)\n    const nodesToCheck = [{node:
```\nvar sortedArrayToBST = function(nums) {\n    if (nums.length === 0) return undefined\n    \n    const root = new TreeNode(0)\n    const nodesToCheck = [{node: root, floor: 0, ceiling: nums.length - 1}]\n    \n    while(nodesToCheck.length) {\n        const { node, floor, ceiling } = nodesToCheck.pop()\n        const middle = Math.ceil((floor + ceiling) / 2)\n        \n        node.val = nums[middle]\n        \n        if (floor < middle) {\n            node.left = new TreeNode(0)\n            nodesToCheck.push({ node: node.left, floor, ceiling: middle - 1 })\n        }\n        \n        if (ceiling > middle) {\n            node.right = new TreeNode(0)\n            nodesToCheck.push({ node: node.right, floor: middle + 1, ceiling })\n        }\n    }\n    \n    return root\n};\n```
['Iterator', 'JavaScript']