[interviewDojo] #4: Check if a tree is a Binary Search Tree

Hi,

Today's problem is a fundamental algorithm to practice traversing tree data structures.

Problem

Given a binary tree, write an efficient algorithm to validate that the tree is a Binary Search Tree (BST). A tree is a BST if for every node in the tree the left child is smaller than the current node and the right child is bigger than the current node.

Solution
Try to solve the problem by yourself and then go over our discussion and solution to learn more.


Interview coming up? Get in touch if you need personal coaching to ace your interview or if you need to practice with mock interviews with experienced engineers who work at the Big 4 tech companies. 

Feel free to forward this email to a friend so that they can subscribe here to receive these emails.
 
Copyright © 2020 Interview Dojo, All rights reserved.
You are receiving this email because you opted in via our website.

No more? .

Email Marketing Powered by Mailchimp

Older messages

[interviewDojo] #3: Binary Trees Boot Camp

Friday, April 10, 2020

Hi, Binary Trees are extremely common in interview questions. Today we review the basics and implement the two most important traversal algorithms: DFS (Depth First Search) and BFS (Breadth First

[interviewDojo] #1: Sorting Boot camp

Thursday, April 9, 2020

Hi! Today we discuss why sorting is important for algorithmic problem solving and we review the most important sorting algorithms. In the following days we will learn how to apply these techniques to

[interviewDojo] #2: Merge K sorted array, size N each

Thursday, April 9, 2020

Hi, Today we solve a classic sorting problem that is full of great patterns and ideas (super useful to solve interview problems). Problem Given K sorted arrays, write an algorithm that merges these

You Might Also Like

Programmer Weekly - Issue 199

Thursday, March 28, 2024

View this email in your browser Programmer Weekly Welcome to issue 199 of Programmer Weekly. Let's get straight to the links this week. Quote of the Week "Optimization hinders evolution.

wpmail.me issue#660

Thursday, March 28, 2024

wpMail.me wpmail.me issue#660 - The weekly WordPress newsletter. No spam, no nonsense. - March 27, 2024 Is this email not displaying correctly? View it in your browser. News & Articles What's

New attack targets Apple devices

Thursday, March 28, 2024

Eufy's new Mach S1 Pro; Using VR in a car; April solar eclipse FAQ -- ZDNET ZDNET Tech Today - US March 28, 2024 placeholder New password reset attack targets Apple device users - what to do if it

Web Tools #558 - ImageKit Review, JS Libraries, Git/CLI Tools, Jamstack

Thursday, March 28, 2024

WEB VERSION Issue #558 • March 28, 2024 The following is a paid product review for ImageKit's Video API, a developer-friendly toolkit for real-time video optimizations and transformations, to help

An Emmy-winner's guide to AI video

Thursday, March 28, 2024

They built this in 2 months 👀 ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

wpmail.me issue#660

Thursday, March 28, 2024

wpMail.me wpmail.me issue#660 - The weekly WordPress newsletter. No spam, no nonsense. - March 27, 2024 Is this email not displaying correctly? View it in your browser. News & Articles What's

Amazon writes Anthropic a $2.75B check

Thursday, March 28, 2024

Amazon has completed its promised $4B investment in the AI company View this email online in your browser By Alex Wilhelm Thursday, March 28, 2024 Welcome to TechCrunch AM! Today we have a giga-round

Airtrain, Pretzel, SpinKube, Glide, GPTScript, and more

Thursday, March 28, 2024

StackShare Weekly Email not displaying correctly? View it in your browser. StackShare Weekly Digest March 28th, 2024 Stop manually typing out what technologies are being used in your repos in README

Web Tools #558 - ImageKit Review, JS Libraries, Git/CLI Tools, Jamstack

Thursday, March 28, 2024

WEB VERSION Issue #558 • March 28, 2024 The following is a paid product review for ImageKit's Video API, a developer-friendly toolkit for real-time video optimizations and transformations, to help

Python Weekly - Issue 644

Thursday, March 28, 2024

View this email in your browser Python Weekly Welcome to issue 644 of Python Weekly. Let's get straight to the links this week. From Our Sponsor Get Your Weekly Dose of Programming A weekly