1.0.2 • Published 6 years ago

linked-list-reverse v1.0.2

Weekly downloads
1
License
ISC
Repository
-
Last release
6 years ago

dd-linked-list-reverse

The package will reverse a linked list. Can be used in combination with linked-list-print package to print the reversed list in a String format.

Installing

npm install --save linked-list-reverse

And in Node:

var reverse = require('linked-list-reverse');

Examples

const reverse = require('linked-list-reverse');
const print = require('linked-list-print');

const c = {
  value: 'c',
  next: undefined,
}

const b = {
  value: 'b',
  next: c,
}

const a = {
  value: 'a',
  next: b,
}


print(a);
// a->b->c

const output = reverse(a);
print(output);
// c->b->a

Authors

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago