LeetCode#1008. Construct Binary Search Tree from Preorder Traversal

Input: preorder = [8,5,1,7,10,12]
Output: [8,5,10,1,7,null,12]
Input: preorder = [1,3]
Output: [1,null,3]
  • 1 <= preorder.length <= 100
  • 1 <= preorder[i] <= 1000
  • All the values of preorder are unique.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
svalak

svalak

Passionate about learning ; Will write about #systemdesign #DSA #algorithms #linuxinternals #technology; Painting/Poem writing are my hobbies; Voracious Reader