Singly linked list code bricks for JavaScript. Parent is
aureooms/js-data-structures.
let head = sll.list( [ 9 , 2 , 5 ] ) ;
Can be managed through jspm,
duo,
component,
bower,
ender,
jam,
spm,
and npm.
Install
jspm
jspm install github:aureooms/js-sll
# or
jspm install npm:@aureooms/js-sll
duo
No install step needed for duo!
component
component install aureooms/js-sll
bower
bower install @aureooms/js-sll
ender
ender add @aureooms/js-sll
jam
jam install @aureooms/js-sll
spm
spm install @aureooms/js-sll --save
npm
npm install @aureooms/js-sll --save
Require
jspm
let sll = require( "github:aureooms/js-sll" ) ;
import sll from '@aureooms/js-sll' ;
duo
let sll = require( "aureooms/js-sll" ) ;
component, ender, spm, npm
let sll = require( "@aureooms/js-sll" ) ;
bower
The script tag exposes the global variable sll
.
<script src="bower_components/@aureooms/js-sll/js/dist/sll.min.js"></script>
Alternatively, you can use any tool mentioned here.
jam
require( [ "@aureooms/js-sll" ] , function ( sll ) { ... } ) ;
Use
let head = sll.list( [ 9 , 2 , 5 ] ) ;
head.value ;
head.next.value ;
head.next.next.value ;
head.next.next.next ;
for ( let value of sll.iter( head ) ) {
}