This Week in Coding: BST

  • Root- The top node in tree
  • Child- A node that is directly connected to another node when moving away from the root
  • Parent- The converse notion of a child
  • Siblings- A group of nodes that have the same parent
  • Leaf- A node that does not have any children
  • Edge- The connection between nodes
  • First let’s check if there is a root. If not, return false.
  • Set variable to track the current node.
  • Set variable to track if we found the value.
  • Set up a while loop that will loop through as long as there is a current and found is equal to false.
  • Check to see if the value is less than current or if is greater than current. Set current accordingly.
  • If value is found update found.
  • If the value is found return current else return false.

--

--

--

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

Recommended from Medium

Number of Students Doing Homework at a Given Time

How I Survived My First Phase of a Coding Bootcamp

Mac Os X Roomba App

Serverless Monitoring Guide

DeckDeckGo Update: Interact With Your Audience With a Live Poll

Become A Great Solution Architect — Chapter 1 — The Mindset And Attitude

AUGMENTING STAFF OR BUILDING PROJECT TEAMS 4 FACTORS TO CONSIDER

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
Jake Lira

Jake Lira

More from Medium

Experience of an Ainu Person During the Tokugawa and Meiji Regimes

Dexie 4.0 Road Map

Tranquility

Here’s What you Missed at The uLesson Game Show