tubeshowcase●894,710 videos♡ My collection 0
← Learn to Code

Learn to Code39:07

Coding Challenge #65.1: Binary Search Tree

The Coding Train ↗

From the creator

This multi-part coding challenge is part of the first week of my course: "Intelligence and Learning." Here I attempt to implement a classic data structure: The Binary Search Tree. Code: https://thecodingtrain.com/challenges/65-binary-tree p5.js Web Editor Sketches: 🕹️ Binary Search Tree: https://editor.p5js.org/codingtrain/sketches/pLFI8gCU9 🕹️ Visualizing a Binary Tree: https://editor.p5js.org/codingtrain/sketches/UBGpfubd1 Other Parts of this Challenge: 📺 Visualizing a Binary Tree: https://youtu.be/KFEvF_ymuzY 🎥 Previous video: https://youtu.be/xXjRlEr7AGk?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH 🎥 Next video: https://youtu.be/MLtAMg9_Svw?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH 🎥 All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH References: 📕 Intelligence and Learning (Spring 2017): https://github.com/shiffman/NOC-S17-2-Intelligence-Learning 📘 Grokking Algorithms book: http://amzn.to/2mMCK7Z 🔴 Live Stream Archive #87.3: https://youtu.be/hVSHlFjTeqg?t=9310s Related Coding Challenges: 🚂 #68 Breadth-First Search: https://youtu.be/piBq7VD0ZSo 🚂 #98 Quadtree: https://youtu.be/OJxEcs0w_kE Timestamps: 0:00 Introducing today's topic: Binary Trees 1:18 Why would you use a binary tree? 3:36 What is a data structure? 4:47 Nodes with children 8:27 Algorithm for how the tree is sorted 11:36 Node object 12:17 Tree object 12:39 Use prototype to add an addNode function 18:58 Use recursion to add nodes 20:42 Deal with the case when two values are equa

Published 2017-03-21 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.

Keep exploring Learn to Code