UNPKG

@sridhar-mani/dsa-js

Version:

A full-fledged data structure library with linked list and double linked list implementation

13 lines (11 loc) 326 B
export default class LLNode<T>{ value: T; next: LLNode<T> | null; constructor(value:T,next: LLNode<T>|null=null){ this.value=value; this.next=next } toString(callbackFunc?:(value:T)=>string):string{ return callbackFunc?callbackFunc(this.value):`${this.value}`; } }