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

dsa-native

v1.2.19

Published

Native addons for data structures and algorithms

Downloads

10

Readme

dsa-native: Native Data Structures and Algorithms

Unleash the power of native JavaScript for efficient data manipulation and problem-solving.

Overview

dsa-native is an npm package providing native implementations of various data structures and algorithms in C++. This package offers efficient and performant implementations of commonly used data structures and algorithms for JavaScript applications, giving developers access to optimized code for handling complex data operations.

Key Features

  • Native Performance: Maximize speed and efficiency by avoiding external dependencies and fully utilizing JavaScript's native features.
  • Foundational Data Structures: Access a variety of essential data structures, including:
    • VectorList
    • LinkedList
    • Stack
    • Queue
  • Sorting Algorithm: Implement the widely used quickSort algorithm for efficient data organization.
  • Open to Contributions: Help expand the library's functionality and contribute to its growth!

Installation

Install the package using npm:

npm install dsa-native
const {
  VectorList,
  LinkedList,
  Stack,
  Queue,
  quickSort,
  quickSortAsync,
} = require("dsa-native");

// Usage examples will be available once the methods are fully implemented.

// VectorList example
const vectorList = new VectorList();
// Perform operations with VectorList methods

// LinkedList example
const linkedList = new LinkedList();
// Perform operations with LinkedList methods

// Stack example
const stack = new Stack([]);
// Perform operations with Stack methods

// Queue example
const queue = new Queue();
// Perform operations with Queue methods

// quickSort example
const arr = [2, 1, 3, 4, 1, 2, "34", 1, "213", 2222, 34, 5, 6, "7", 8, 0];
// asynchronous method
quicksortAsync(arr).then((data) => console.log(data));
// synchronous method
const result = quickSort(arr);

// Merge sort
// Merge sort methods usage will be shown once implemented

| Algorithm Name | Input Size | Time Taken by Native Code (seconds) | Time Taken by JS Implementation (seconds) | | -------------- | ---------- | ----------------------------------- | ----------------------------------------- | | QuickSort | 10,000,000 | 4.877 | 7.377 | | | | | | | | | | | | | | | |

Available Data Structures and Algorithms

Data Structures:

  • VectorList: A vector based implementation of a linkedlist.
  • LinkedList: A linear collection of nodes, providing flexibility in insertion and deletion.
  • Stack: A LIFO (Last-In-First-Out) data structure for managing ordered operations.
  • Queue: A FIFO (First-In-First-Out) data structure for handling sequential tasks.

Algorithm:

  • quickSort: A divide-and-conquer sorting algorithm known for its efficiency.

Contributing

dsa-native is open to contributions. You can contribute by implementing methods, fixing bugs, improving documentation, or suggesting enhancements. Please follow the guidelines in the CONTRIBUTING.md file.

Documentation in Progress

Detailed documentation for individual data structures and algorithms is currently under development. Stay tuned for updates!