DEV Community

Discussion on: Implementing a Basic Binary Search Tree in JavaScript

Collapse
 
ninjainpajama profile image
ninja in pajama • Edited

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]
Image

Update: I got it, it will become unbalanced binary tree when input is 1,2,3,4