I’ve been on a path to learning more about data structures this last week and decided to dedicate this blog to some cool things I found that others might not know about.
Notably, the first thing I thought of after watching so many people code the structures out for each project is ‘shouldn’t there just be a package for this?’. See for many reasons most languages don’t have these complex data structures available out of the box read me about that here and here. I do understand that It’s to teach people what they look like and how to build them.
That being said, this here datastructures-js
npm package works like any other with import/require
:
// FROM datastructures-js docs
const Trie = require('@datastructures-js/trie');
// OR
import Trie from '@datastructures-js/trie';
The documentation is clear, well written and easy to understand. plus, it shows the time complexity of each method.
I also found an amazing storybook that helps visualize a data structure and use common methods on it which allows you to see how the structure changes when changes are made to it. It also provides algorithms. The same person that made the story book also has a published npm package js-data-structures-and-algorithms
in which you can import/require
data structures an algorithms.
Resources:
SO data structure integration(1)
SO data structure integration(2)
Evas - datastructures-js - npm
Tyler Hawkins - js-data-structures - npm
Other:
FCC YT data structures and algoriths