SarthakKeshari / Java-Questions-and-Solutions

This repository aims to solve and create new problems from different spheres of coding. A path to help students to get access to solutions and discuss their doubts.
MIT License
46 stars 95 forks source link

binary tree #417

Closed satyam878 closed 2 years ago

satyam878 commented 2 years ago

Issue Id you have worked upon -

416

Briefly explain your program logic -

In this question i have use the indexes of the preorder array. We use the basic property of BST i.e, right subtree has bigger value and left tree has smaller value than the root.

Screenshots(Attach 2 screenshots of your own input and output) -

image image


Checklist:

Eg - If your code follow the below guidelines. Kindly change [] to [x]

All the conditions should be fulfilled for considering your code for merging -

satyam878 commented 2 years ago

Kindly accept my pull request @SarthakKeshari

SarthakKeshari commented 2 years ago

@satyam878, I Appreciate the code presentation, organization and commenting Appreciating by Leveling up your question from level2 to level3