npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

smart-ll

v0.0.3

Published

Its a simple implementation of Linked-List

Downloads

2

Readme

Smart LinkedList

This repository have codes for node module "smart-ll" aka "Smart linked-list".

Installation

npm install smart-ll --save

Features

  • Simplest yet powerful implementation of Linked-List data structure.
  • Focus on high performance
  • Additional features as "reverse list"
  • Super-high test coverage

Basic Usage

var smartll = require('smart-ll');

//this will intialize a new LinkedList Object and assign it to var linkedList
var linkedList = smartll.linkedList();

List Node Structure

List will be form in following node format


var node = {
	value : '<value>',
	next : <next-node>
}

Method Description

insert(value)

This function will insert any data to end of the list.

var smartll = require('smart-ll');

var linkedList = smartll.linkedList();
linkedList.insert(1);
linkedList.insert('string');
linkedList.insert([2,3,4]);
linkedList.insert({'name':'alok'});

setNodeAtIndex(index {integer}, value)

This function will insert any data at specific index of the list.

var smartll = require('smart-ll');

var linkedList = smartll.linkedList();
linkedList.setNodeAtIndex(1,1);
linkedList.setNodeAtIndex(1,'string');
linkedList.setNodeAtIndex(4,[2,3,4]);
linkedList.setNodeAtIndex(6, {'name':'alok'});

getNodeAtIndex(index {integer})

This function will return node (refer node structure above) at specific index of the list.

linkedList.setNodeAtIndex(4);

getSize()

This function will return current size of the list.

linkedList.getSize();

getFirstNode()

This function will return first node of the list.

linkedList.getFirstNode();

getLastNode()

This function will return last node of the list.

linkedList.getLastNode();

removeNodeAtIndex(index {integer})

This function will delete node at specific index of the list.

var smartll = require('smart-ll');
var linkedList = smartll.linkedList();
linkedList.insert(1);

linkedList.removeNodeAtIndex(0);

console.log(linkedList.getSize()) //it'll print zero as inserted node is removed.

reverseList()

This function will reverse the list.

var smartll = require('smart-ll');
var linkedList = smartll.linkedList();
linkedList.insert(1);
linkedList.insert('2');
linkedList.insert('three');
linkedList.insert({'value':'four'});

//it will completely reverse above list.
linkedList.reverseList();

printList

This function will print all nodes's values of the list over console.

linkedList.printList();

please refer spec folder for jasmine tests.