Skip to content
This repository has been archived by the owner on Nov 14, 2019. It is now read-only.

Examples of algorithms and abstract data types in modern ecmascript

Notifications You must be signed in to change notification settings

harmonsoftwaresolutions/hss-algorithms-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hss-algorithms-js

Examples of using algorithms / Abstract Data Types in javascript. Prefers ES6/ES7 styles where possible.

Running the tests

yarn run ava:watch

Stacks

Arrays in javascript are dynamic - no isFull() function is necessary.

Simple stack example using ES6 classes. Place the functions inside the constructor to access the privately scoped array.

lib/stack.js

class Stack {
  constructor() {
    // use scope for private property
    const array = [];

    this.push = item => array.push(item);

    // etc ...
  }
}

About

Examples of algorithms and abstract data types in modern ecmascript

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published