Data Structures in JS: Binary Search Trees
Tags: javascript
Published: 2020-12-26 06:25:30

---
title: Data Structures in JS: Binary Search Trees
published: true
date: 2020-04-05 12:29:00 UTC
tags: JavaScript
canonical_url: https://drmsite.blogspot.com/2020/04/data-structures-in-js-binary-search.html
---

[![](https://4.bp.blogspot.com/-DbO67XKuFfA/XonK-OnI18I/AAAAAAAAlyI/15atxBB1JV0as-zGFB9VuHGTiVKJqNCvQCLcBGAsYHQ/s400/green_tree_on_brown_sand_under_blue_sky-scopio-37c6d0b4-05be-4096-9b7d-aad998b69949.jpg)](https://4.bp.blogspot.com/-DbO67XKuFfA/XonK-OnI18I/AAAAAAAAlyI/15atxBB1JV0as-zGFB9VuHGTiVKJqNCvQCLcBGAsYHQ/s1600/green_tree_on_brown_sand_under_blue_sky-scopio-37c6d0b4-05be-4096-9b7d-aad998b69949.jpg)

Now for my notes on Binary Search Trees (the sequel of [Data Structures in JS: Linked Lists](https://dev.to/mouseannoying/data-structures-in-js-linked-lists-1jml-temp-slug-3782827)):

- [Recursion - part 1](https://subscription.packtpub.com/video/programming/9781800206878/p3/video3_2/-recursion-part-1) [https://jsfiddle.net/annoyingmouse/Lp02ams1/](https://jsfiddle.net/annoyingmouse/Lp02ams1/)
- [Recursion part 2 and the Call Stack](https://subscription.packtpub.com/video/programming/9781800206878/p3/video3_3/-recursion-part-2-and-the-call-stack) [https://jsfiddle.net/annoyingmouse/jyk5rcfp/](https://jsfiddle.net/annoyingmouse/jyk5rcfp/)
- [Insert Method](https://subscription.packtpub.com/video/programming/9781800206878/p3/video3_4/-insert-method) [https://jsfiddle.net/annoyingmouse/9cq14ftw/](https://jsfiddle.net/annoyingmouse/9cq14ftw/)
- [Testing Insert](https://subscription.packtpub.com/video/programming/9781800206878/p3/video3_5/-testing-insert) [https://jsfiddle.net/annoyingmouse/0w53az1L/](https://jsfiddle.net/annoyingmouse/0w53az1L/)
- [Contains Method](https://subscription.packtpub.com/video/programming/9781800206878/p3/video3_6/-contains-method) [https://jsfiddle.net/annoyingmouse/5objf4uk/](https://jsfiddle.net/annoyingmouse/5objf4uk/)
- [Testing Contains](https://subscription.packtpub.com/video/programming/9781800206878/p3/video3_7/-testing-contains) [https://jsfiddle.net/annoyingmouse/w7vr5qLf/](https://jsfiddle.net/annoyingmouse/w7vr5qLf/)
- [Depth First Traversal - In-Order](https://subscription.packtpub.com/video/programming/9781800206878/p3/video3_8/-depth-first-traversal-in-order) [https://jsfiddle.net/annoyingmouse/zwg3be9u/](https://jsfiddle.net/annoyingmouse/zwg3be9u/)
- [Testing Depth First Traversal In-Order](https://subscription.packtpub.com/video/programming/9781800206878/p3/video3_9/-testing-depth-first-traversal-in-order) [https://jsfiddle.net/annoyingmouse/1rqnwb5y/](https://jsfiddle.net/annoyingmouse/1rqnwb5y/)
- [Depth First Traversal - Pre-Order](https://subscription.packtpub.com/video/programming/9781800206878/p3/video3_11/-depth-first-traversal-pre-order) [https://jsfiddle.net/annoyingmouse/qojt4v3p/](https://jsfiddle.net/annoyingmouse/qojt4v3p/)
- [Testing Depth First Traversal Pre-Order](https://subscription.packtpub.com/video/programming/9781800206878/p3/video3_12/-testing-depth-first-traversal-pre-order) [https://jsfiddle.net/annoyingmouse/aj71pfz0/](https://jsfiddle.net/annoyingmouse/aj71pfz0/)
- [Depth First Traversal - Post-Order](https://subscription.packtpub.com/video/programming/9781800206878/p3/video3_13/-depth-first-traversal-post-order) [https://jsfiddle.net/annoyingmouse/k7bmphqw/](https://jsfiddle.net/annoyingmouse/k7bmphqw/)
- [Breadth First Traversal - part 1](https://subscription.packtpub.com/video/programming/9781800206878/p3/video3_14/-breadth-first-traversal-part-1) [https://jsfiddle.net/annoyingmouse/qy8L2x40/](https://jsfiddle.net/annoyingmouse/qy8L2x40/)
- [Breadth First Traversal - part 2](https://subscription.packtpub.com/video/programming/9781800206878/p3/video3_15/-breadth-first-traversal-part-2) [https://jsfiddle.net/annoyingmouse/d2ec73L5/](https://jsfiddle.net/annoyingmouse/d2ec73L5/)
- [Testing Breadth First Traversal](https://subscription.packtpub.com/video/programming/9781800206878/p3/video3_16/-testing-breadth-first-traversal) [https://jsfiddle.net/annoyingmouse/kj78xf5w/](https://jsfiddle.net/annoyingmouse/kj78xf5w/)
- [Binary Search Tree - Independent Exercise](https://subscription.packtpub.com/video/programming/9781800206878/p3/video3_17/-binary-search-tree-independent-exercise) [https://jsfiddle.net/annoyingmouse/muzp0b7d/](https://jsfiddle.net/annoyingmouse/muzp0b7d/)
- [Binary Search Tree - Exercise Review](https://subscription.packtpub.com/video/programming/9781800206878/p3/video3_18/-binary-search-tree-exercise-review) [https://jsfiddle.net/annoyingmouse/0gnjs9zL/](https://jsfiddle.net/annoyingmouse/0gnjs9zL/)

Again, lots of fun! Intrigued that my `min` and `max` functions were different, knew I should've used recursion!