Huzaima Khan 6b354ad4ce Added doubly linked list (#92)
* Added doubly linked list

* improved doubly linked list coverage
2018-07-05 15:18:57 +03:00

12 lines
269 B
JavaScript

export default class DoublyLinkedListNode {
constructor(value, next = null, previous = null) {
this.value = value;
this.next = next;
this.previous = previous;
}
toString(callback) {
return callback ? callback(this.value) : `${this.value}`;
}
}