Coder Social home page Coder Social logo

bst-tests's Introduction

#Tests for Binary Search Tree ####How to use?

  1. git clone
  2. npm i
  3. Export structure and BST class from index.js file
module.exports = {
  //BST class
  BinarySearchTree,
  //root name
  root: '_root',
  //left and right nodes
  left: 'left',
  right: 'right',
  student: 'STUDENT NAME'
};

After that run npm run test and enjoy โœ…

Binary search tree

Implement data structure "binary search tree". It should be done as a stand-alone, clean, independent component, which can be used wherever needed. B.S.T. should have the following methods (you can add your own methods, but the 7 listed below must be and named exactly as stated):

  • root (no param) returns root* of the tree;
  • insert (param: key, value) stores specified value in tree using key; method should be chainable**;
  • delete (param: key) removes node from tree by provided key; method should be chainable**;
  • search (param: key) looking for stored data in tree using key;
  • contains (param: value) returns whether BST contains such value or not;
  • traverse (param: order) retrieves ordered sequence of stored values in given oreder (order is boolean)
  • verify (no param) verifies whether tree is well-formed binary search tree or not

bst-tests's People

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.