Skip to main content

Common data structures for use in algorithms and other manipulations

This package works with Node.js, Bun, Browsers
This package works with Node.js
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
6 months ago (0.1.0)
method SinglyLinkedList.prototype.remove
SinglyLinkedList.prototype.remove(index: number): T | null

Remove element with certain index from the list

Examples

Remove second element from the list

const list = SinglyLinkedList.from<number>([1, 2, 3]);

list.remove(1);

console.log([...list]);
// Output: [1, 3]

Parameters

index: number

the value that will be unshifted to the list

Return Type

T | null

node value if it's stored in the list, null if not

Add Package

npx jsr add @onetools/data-structures

Import symbol

import { SinglyLinkedList } from "@onetools/data-structures";

Add Package

yarn dlx jsr add @onetools/data-structures

Import symbol

import { SinglyLinkedList } from "@onetools/data-structures";

Add Package

pnpm dlx jsr add @onetools/data-structures

Import symbol

import { SinglyLinkedList } from "@onetools/data-structures";

Add Package

bunx jsr add @onetools/data-structures

Import symbol

import { SinglyLinkedList } from "@onetools/data-structures";