VehiclesFashionRecipesBlogsHuntTravelsSportFunHandmadeITEducation
Mini-Games
x

x
zakruti.com » IT - Software » freeCodeCamp.org
Binary Search Tree: Traversal & Height - Beau teaches JavaScript

Binary Search Tree: Traversal & Height - Beau teaches JavaScript

FBTwitterReddit

video description

Rating: 4.0; Vote: 1
This video builds upon the previous binary search tree video. Find the height of a binary search tree. Also, use use depth-first and breadth-first search through in-order, pre-order, post-order, and level-order traversal. -Part 1: https://youtu.be/5cU1ILGy6dM - Code: http://codepen.io/beaucarnes/pen/ryKvEQ?editors=0011 - Info: https://en.wikipedia.org/wiki/Binary_search_tree - Beau Carnes on
Date: 2022-03-14

Comments and reviews: 4


Thank you for the video, but I am confused in the min and max functions as you are adding 1 to an object? node.right/node.left would be a an object with value, left, and right properties, so how is it that you can add a number to an object? And how can objects be greater than or less than other objects in the if statements? Sorry, I'm very confused here, I know I'm not understanding something in the code.
reply

Hmm Your level order traversal was really complicated for me to implement in python. as I am following along in python. I stumble upon an easier pseudo code that uses queue
- Enqueue node
- while queue has element
- deque node
- process node
- enqueue node children
Great set of tutorials thought.

reply

Beau should explain what kind of intuition inspired this implementation of findMinHeight() and findMaxHeight() functions. The levelOrder() was just an ingenious implementation. Nice.
reply

i'm still confused about the findMinHeight() and findMaxHeight() functions if you could explain each line of code for those functions, that would be great.
reply
Add a review, comment






Other channel videos