Binary Search Trees

So what are trees? And what are binary trees?

class Node {
constructor(value){
this.value = value }
}
class BinarySearchTree{
constructor(){
this.values = [] }
}

But what makes binary trees unique and what are they used for?

let arr = [6, 9, 7, 3, 5]
// index 0 1 2 3 4
arr.unshift(8) arr = [8, 6, 9, 7, 3, 5]
// index 0 1 2 3 4 5

--

--

--

just a junior developer navigating through problems in Rails and React. I like sharing my solutions, thinking processes and sometimes frustration..

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

Recommended from Medium

Having Fun With Elixir Streams

Choosing a language for Freshdesk Microservices

Build an Interactive, Modern Dashboard With Dash

How to setup SSL on the fly for multiple custom domains pointing to the same server?

Application Modernization and Complexity Debt

Education — find the right resources for your Career

Container Orchestration using Kubernetes (k8) -from scratch using Minikube

Dialogflow Rich Responses Click event

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
Saman Batool

Saman Batool

just a junior developer navigating through problems in Rails and React. I like sharing my solutions, thinking processes and sometimes frustration..

More from Medium

Arrays in Java

189. Rotate Array | Leetcode | Medium | Java

[LeetCode][C++] #26. Remove Duplicates from Sorted Array

Sort Array By Parity — LeetCode