1.0.1 • Published 1 year ago

@eneko96/linkedlist v1.0.1

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

Linked List

Example of usage

const main = () => {
  const linkedList = new LinkedList();
  // mega big list
  for (let i = 0; i < 60; i++) {
    linkedList.insertNode(i);
  }

  // find several elements
  for (let i = 0; i < 60; i++) {
    linkedList.findNode(i);
  }

  for (let i = 0; i < 50; i++) {
    linkedList.deleteNode(i);
  }
}

const commonList = () => {
  const list = [];
  for (let i = 0; i < 60; i++) {
    list.push(i);
  }

  // find several elements
  for (let i = 0; i < 60; i++) {
    list.find((item) => item === i);
  }

  for (let i = 0; i < 50; i++) {
    list.splice(i, 1);
  }
}
1.0.1

1 year ago

1.0.0

1 year ago