Giter Club home page Giter Club logo

binary-tree-js's Introduction

Binary Tree In JavaScript

This assignment will require you to implement a binary tree with the following methods.

insertIteratively: inserts a node in the proper location using iteration

insertRecursively: inserts a node in the proper location using recursion

containsIteratively: checks to see if the tree contains a node iteratively

containsRecursively: checks to see if the tree contains a node recursively

findLowest: finds the lowest value in the tree

findHighest: finds the lowest value in the tree

breadthFirstSearch: traverses through the tree and returns an array of all of the values using Breadth First Search (from left to right) - you can read more about it here

DFSPreOrder: traverses through the tree and returns an array of all of the values using Depth First Search Pre-order - you can read more here

DFSInOrder: traverses through the tree and returns an array of all of the values using Depth First Search In-order - you can read more here

DFSPostOrder: traverses through the tree and returns an array of all of the values using Depth First Search Post-order - you can read more here

size : calculates how many nodes are in the tree (do this without adding a size property to your tree! Use a traversal method to calculate this!)

Bonus

remove: removes a node from a binary tree. Remember that this method must take into account if the node has any children and if the node is a leaf. Here is a great video that explains this process.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.