ts-lists
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

TS-LinkedList-and-Queue

Typescript LinkedList and Queue

Install

npm i ts-lists

Import

import { LinkedLIst, Queue } from 'ts-lists';

Declarations

LinkedList

export declare class LinkedList<T> {
  private internalSize;
  private internalHead?;
  private internalTail?;
  constructor(...args: T[]);
  get head(): ListNode<T>;
  get tail(): ListNode<T>;
  set head(node: ListNode<T>);
  set tail(node: ListNode<T>);
  get size(): number;
  getNodeByIndex(index: number): ListNode<T>;
  remove(index: number): T;
  insert(value: T, index?: number): void;
  protected indexValidation(index: number): void;
  clear(): void;
  [Symbol.iterator](): Generator<T>;
  get isEmpty(): boolean;
}

Queue

export declare class Queue<T> {
  protected list: LinkedList<T>;
  constructor(...args: T[]);
  get size(): number;
  enqueue(value: T): void;
  dequeue(): T;
  get front(): T;
  get back(): T;
  get isEmpty(): boolean;
  [Symbol.iterator](): Generator<T>;
}

Author

Readme

Keywords

Package Sidebar

Install

npm i ts-lists

Weekly Downloads

4

Version

1.1.1

License

MIT

Unpacked Size

8.77 kB

Total Files

9

Last publish

Collaborators

  • bityoungjae