hi @seanwelshbrown nice implementation in JS. But this is failing when the values are in incremental order itself. Lets take example of 1,2,3,4
then the output is this - [It have only right nodes]
Update: I got it, it will become unbalanced binary tree when input is 1,2,3,4
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
hi @seanwelshbrown nice implementation in JS. But this is failing when the values are in incremental order itself.
Lets take example of 1,2,3,4
then the output is this - [It have only right nodes]
Update: I got it, it will become unbalanced binary tree when input is 1,2,3,4