0.9.9 • Published 1 year ago

sll-js v0.9.9

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

SinglyLinkedList-JS


자바스크립트로 구현한 단반향 연결 구조인 singlyLinkedList 자료구조입니다

해당 자료구조는 이터러블 프로토콜을 준수합니다

Installation


npm i sll-js --save

Test

npm run test

Using

import Sll from 'sll-js';

const sll = new Sll();

sll.push( 100 ).push( 300 );

for ( const item of sll ){
    console.log( "item" , item ); // 100 , 300
}

console.log( sll.tail ) // 300;

Properties

head : Node<T>;               // 첫 번째 Node 입니다
tail : Node<T>;               // 마지막 Node 입니다
get length() : number;        // linkedList 의 길이입니다

Methods


push( val : T ) : this;                             // 마지막 Node 를 삽입합니다
pop() : Node<T> | void;                             // 마지막 Node 를 제거합니다
shift() :  Node<T> | void;                          // 첫번째 Node 를 제거합니다
unshift( val : T ) : this;                          // 첫번째 Node 를 삽입합니다
get( index : number ) : Node<T> | null;             // index Node 를 반환합니다

set( index : number , val : T ) : boolean;          // index Node 를 설정합니다
insert( index : number , val : T ) : boolean;       // index Node 를 삽입합니다
remove( index : number ) : Node<T> | void;          // index Node 를 제거합니다
rotate( index : number ) : Node<T> | null ;         // index 부터 재정렬 후 index Node 를 반환합니다
reverse() : this;                                   // list 를 뒤집습니다

[ Symbol.iterator ]() : IterableIterator<Node<T>>   // 이터레이터를 반환합니다
0.9.9

1 year ago

0.9.8

1 year ago

0.9.7

1 year ago

0.9.6

1 year ago

0.9.5

1 year ago

0.9.4

1 year ago

0.9.3

1 year ago

0.9.2

1 year ago

0.9.1

1 year ago