Validate Binary Search Tree

Example of a binary search tree(BST)
code to validate BST
recursive call till validateBstHelper(12, -2147483647, 16)
recursive call till validateBstHelper(10, -2147483647, 12)
recursive call till validateBstHelper(11, 10, 12)
recursive call till validateBstHelper(11, 10, 12)
Recursive tree after validateBstHelper(10, -2147483647, 12) has returned true
recursive call till validateBstHelper(14, 12, 16)
Recursive tree after validateBstHelper(14, 12, 16) has returned true
Recursive tree after validateBstHelper(12, -2147483647, 16) has returned true
Recursive call till validateBstHelper(20, 16, 2147483647)
Recursive call till validateBstHelper(18, 16, 20)
Recursive call till validateBstHelper(17, 16, 18)
Recursive tree after validateBstHelper(17, 16, 18) has returned true
Recursive tree after validateBstHelper(18, 16, 20) has returned true
Recursive call till validateBstHelper(21, 20, 2147483647)
Recursive tree after validateBstHelper(21, 20, 2147483647) has returned true
Recursive call tree for the whole tree

--

--

--

Software Engineer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

GUI utility generating Exchange mailboxes audit reports

An Introduction to Data Collection: Pulling OpenAQ Data from S3 using AWS Athena.

enticing Garnet Silv http://ift.tt/2krO4K7

The Top Three List-Making Apps

Practice, practice, practice

Why Real-world Data is a Gold Rush Hidden in Plain Sight.

The Recharge Weekly Update (Week 3, December)

The Observer Design Pattern

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
Shaila Nasrin

Shaila Nasrin

Software Engineer

More from Medium

Everything about Tree traversal- Inorder, preorder, postorder, time complexity with code

Find Mode in Binary Search Tree

Rapper Lil Carter Talks About Fortnite & New Music With Medium — Stephen Best

How to rotate image (matrix) to 90° in-place using O(n) time