Skip to content

Research project on CS. A little library that implements binary search trees as a basic structure and several wrappers for more efficient work with them (balancing, high-levelled data structures, etc)

Notifications You must be signed in to change notification settings

iamo0/binary-trees

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Binary trees

Research project on Computer Science. A little library that works with binary trees. Written in pure Node.js (even with Common.js modules), tested with Jest.

Functionality

  • Create trees
  • Insert items in a correct order
  • Traverse trees
    • Inorder
    • Preorder
    • Breadth-first search
  • Lookup nodes in a tree
  • Delete nodes from tree
  • Balancing tree using Black-Red Tree (Work in Progress)

All code is written in TDD, so there's a unit-test for each function. Works great as a documentation.

TODO:

  • Black-Red Tree implementation for balancing trees
    • Colouring nodes to black and red
    • Checking if tree is correctly balanced
    • Inserting a node with rebalancing the tree afterwards
    • Deleting a node with rebalancing the tree afterwards
  • Speed tests
  • Custom comparison functions (now it uses standard JS comparison operator)

About

Research project on CS. A little library that implements binary search trees as a basic structure and several wrappers for more efficient work with them (balancing, high-levelled data structures, etc)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published