Given the root of a binary tree, determine if it is a valid binary search tree (BST). There are various methods to do so, here I have discussed following methods:
Using Min and Max nodes
Using Inorder Traversal (Recursion, Stack, Morris Traversal)
Source code: https://github.com/fit-coder/fitcoder...
00:00 Introduction
00:05 Common mistake people do
01:33 Method 1: Using Min and Max nodes
09:56 Method 2: Using Inorder Traversal
14:46 Other 2 methods of doing Inorder Traversal
15:17 Implementation
-------------------------------------------------------------
I live in New Delhi and love explaining programming concepts. I have done M.Tech(BITS Pilani) + B.Tech(PEC, Chandigarh) in Computer Science and am currently working as a software engineer in a MNC.
If you like my content, please like, share my videos and subscribe to the channel.
-------------------------------------------------------------
For other BST tutorials, please refer to the below links:
Introduction to BST: • Introduction to Binary Search Trees | BST ...
Delete node in BST: • Delete a node from Binary Search Tree | BST
LCA in BST: • Lowest Common Ancestor (LCA) in Binary Sea...
For other tree tutorials, please refer to the below playlist:
• Tree Data Structures
For in-depth Graph theory and implementation details, please refer to the below playlist:
• Graph Algorithms
#DataStructure,#Trees,#FitCoder,#Algorithm,#competitiveprogramming,#binarytree,#binarysearchtree