Is this binary search tree correct?

23 Views Asked by At

I have made a binary search tree from this sequence: 4, 1, 7, 5, 6, 3, 0, 2, 9, 8

And I just want to make sure that it is correct. Starting with 4. Then 1 which is less than 4 so its placed on the left side. 7 is greater than 4 so it becomes the right child of 4. 5 is less than 7 so it becomes the left child of 7. 6 is greater than 5 so it becomes the right child of 5. 3 is greater than 1 so it becomes the right child of 1. 0 is less than 1 so it becomes the left child of 1. 2 is less than 3 so it becomes the left child of 2. 9 is greater than 7 so it becomes the right child of 7. And finally 8 which is less than 9 so it becomes left child of 9. Is this correct?

enter image description here