DEV Community

Oscar Luna
Oscar Luna

Posted on • Edited on

2 1

JavaScript Data Structures and Algorithms (Trees, part 1)

Hello! In this 5th post about JavaScript data structures and algorithms I will be discussing trees and how we run insert, append, prepend, traverse, and delete operations for then. ...

Trees are data structures that consist of a parent node, and two child nodes, referred to as the left child and right child, respectively:


class Node {
  constructor(value){
    this.left = null;
    this.right = null;
    this.value = value;
  }
}

class BinarySearchTree {
  constructor(){
    this.root = null;
  }
    ...
}

Enter fullscreen mode Exit fullscreen mode

}
}
}



Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay