Convert Sorted Array to Binary Search Tree || Leetcode Easy 108 || BST

Опубликовано: 28 Июнь 2026
на канале: Digital Interview
36
3

Given an integer array nums where the elements are sorted in ascending order, convert it to a height-balanced binary search tree.

A height-balanced binary tree is a binary tree in which the depth of the two subtrees of every node never differs by more than one.

Input: nums = [-10,-3,0,5,9]
Output: [0,-3,9,-10,null,5]
Explanation: [0,-10,5,null,-3,null,9] is also accepted

Get notified about all off campus jobs/interviews and the process.
We are building our website and it will be back soon with lots of content till then subscribe us on youTube.
https://t.me/tech_geek1

Interview Preparation Sheet:    • INTERVIEW PREPARATION SHEET - HASHEDIN and...  

Link for Leetcode solutions:    • Leetcode Solutions  

Link for placement series:
Placement 2022:    • Placements 2022  
Placement 2023:    • Placements 2023  

#leetcode #leetcodesolution