New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

dl-doubly-linked-list-ts

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dl-doubly-linked-list-ts

A Typescript library for doubly linked-list implementation.

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Doubly Linked List for TypeScript

A doubly linked-list implementation for TypeScript.

Installation

NPM

npm install dl-doubly-linked-list-ts

Build

tsc

Built JS files are in ./js.

Description

Node

A node is a vertex in the list, implemented in the DLNode class and has three fields:

FieldTypeGetterSetterDescription
dataT (generic)YesYesData object contained in the node.
next`DLNodenull`YesYes
preious`DLNodenull`YesYes

Doubly Linked List

The doubly linked-list implementation is present in the DoublyLinkedList class. It has three fields:

FieldTypeGetterSetterDescription
lengthnumberYesNoNumber of nodes present in the list.
start`DLNodenull`YesYes
end`DLNodenull`YesYes

Documentation

Please refer to doc/index.html for the complete documentation and API reference. The documentation for this project was generated using Compodoc.

Demo

import { DoublyLinkedList, DLNode } from "./node_modules/dl-doubly-linked-list";

let list : DoublyLinkedList<any> = new DoublyLinkedList();

let nodes : DLNode<any>[] = [];
for(let i=0; i<10; i++) {
    nodes[i] = new DLNode(); 
    nodes[i].data = i * i;
    list.insertStart(nodes[i]);
}

// Inserting new node at the end
let newNode : DLNode<any> = new DLNode();
newNode.data = 300;
list.insert( newNode, 6 );

// Deleting a node
list.delete(4);

// Get array of the nodes
let array = list.toArray();

console.log(array);

Keywords

FAQs

Package last updated on 28 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc