Validate Binary Search Tree (LeetCode 98) | Full solution with animations and visuals

Nikhil Lohia • February 27, 2023
Video Thumbnail
Nikhil Lohia Logo

Nikhil Lohia

View Channel

About

I want to share with you my knowledge, that I have gained all my life. I like to see every task in your day to day life as an interesting problem to solve, and if you can understand the requirements, solving for it can become somewhat intuitive. I try to explore certain aspects of day to day life and how I can make them easier for you. This involves daily hacks, tutorials, innovations, new discoveries, experiences and all the stuff I find amusing. As a software engineer myself, I also believe that good problem solving skills can help you overcome most of the barriers in life. Programming is one of them. If you know how to approach a problem, writing a code for it in any language could be a very typical task. With this channel I aim to focus on the way to solve a problem efficiently rather than just its implementation.

Video Description

Actual Problem: https://leetcode.com/problems/validate-binary-search-tree/ Chapters: 00:00 - Intro 01:02 - Problem Statement and Description 03:29 - A level order traversal won't work 06:06 - Different tree traversals 10:07 - Using in-order traversal 12:29 - Dry-run of Code 15:27 - Final Thoughts 📚 Links to topics I talk about in the video: Level Order Traversal: https://youtu.be/9M3oCwPGamE Pre-order Traversal: https://youtu.be/Ifj-2aqSMnE Post-order Traversal: https://youtu.be/ZIXGxg8ZLKs In-order Traversal: https://youtu.be/Ifj-2aqSMnE Binary Tree: https://youtu.be/jxdEgfAsEg0 Binary Search Tree: https://youtu.be/hqkpg_9OnLM 📘 A text based explanation is available at: https://studyalgorithms.com Code on Github: https://github.com/nikoo28/java-solutions/blob/master/src/main/java/hackerrank/datastructures/trees/IsBinarySearchTree.java Test-cases on Github: https://github.com/nikoo28/java-solutions/blob/master/src/test/java/hackerrank/datastructures/trees/IsBinarySearchTreeTest.java 📖 Reference Books: Starting Learn to Code: https://amzn.to/36pU0JO Favorite book to understand algorithms: https://amzn.to/39w3YLS Favorite book for data structures: https://amzn.to/3oAVBTk Get started for interview preparation: https://amzn.to/39ysbkJ 🔗 To see more videos like this, you can show your support on: https://www.buymeacoffee.com/studyalgorithms 🎥 My Recording Gear: Recording Light: https://amzn.to/3pAqh8O Microphone: https://amzn.to/2MCX7qU Recording Camera: https://amzn.to/3alg9Ky Tablet to sketch and draw: https://amzn.to/3pM6Bi4 Surface Pen: https://amzn.to/3pv6tTs Laptop to edit videos: https://amzn.to/2LYpMqn 💻 Get Social 💻 Follow on Facebook at: https://www.facebook.com/studyalgos Follow on Twitter at: https://www.twitter.com/studyalgorithms Follow on Tumblr at: https://studyalgos.tumblr.com/ Subscribe to RSS feeds: https://studyalgorithms.com/feed/ Join fan mail: http://eepurl.com/g9Dadv #leetcode #programming #interview

You May Also Like

No Recommendations Found

No products were found for the selected channel.