JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 16
  • Score
    100M100P100Q43433F
  • License ISC

Common data structures implementation for javascript

Package Exports

  • jstandard

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jstandard) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

JStandard Build Status Maintainability codecov Inline docs HitCount

JStandard offers standard data structures for javascript, paying attention to performance and developer-friendly usage.

Javascript developer pays little to none attention to the correct usage of Data Structures since most of them are not (well) coded, are not performant or easy to use. This library aims to cover the most common Data Structures covered by a sweet suit of unit tests!

Structures Available

Usage Example


import { tree } from 'jstandard';

//Create a new Binary Search Tree
const binarySearchTree = new tree.BinarySearchTree();

//Set iteration mode to desired mode
binarySearchTree.setIterationMode(tree.BinarySearchTree.INORDER);

//Insert random values
binarySearchTree.insert(1); 
binarySearchTree.insert(4); 
binarySearchTree.insert(3); 
binarySearchTree.insert(6); 
binarySearchTree.insert(7);
binarySearchTree.insert(2); 
binarySearchTree.insert(3); 
binarySearchTree.insert(9); 
binarySearchTree.insert(19); 
binarySearchTree.insert(20); 
binarySearchTree.insert(3); 
binarySearchTree.insert(15);

//Iterate natively
for (let node of binarySearchTree) {
    console.log(node.value);
}

// OUPUT 1 2 3 3 3 4 6 7 9 15 19 20

Usage Example

<script src="node_modules/jstandard/build/jstandard.js"></script>
<script>
    //Create a new Binary Search Tree
    const binarySearchTree = new JStandard.tree.BinarySearchTree();

    //Set iteration mode to desired mode
    binarySearchTree.setIterationMode(JStandard.tree.BinarySearchTree.INORDER);

    //Insert random values
    binarySearchTree.insert(1);
    binarySearchTree.insert(4);
    binarySearchTree.insert(3);
    binarySearchTree.insert(6);
    binarySearchTree.insert(7);
    binarySearchTree.insert(2);
    binarySearchTree.insert(3);
    binarySearchTree.insert(9);
    binarySearchTree.insert(19);
    binarySearchTree.insert(20);
    binarySearchTree.insert(3);
    binarySearchTree.insert(15);

    //Iterate natively
    for (let node of binarySearchTree) {
        console.log(node.value);
    }

    // OUPUT 1 2 3 3 3 4 6 7 9 15 19 20
</script>