0.0.6 • Published 4 years ago
interview.js v0.0.6
Description
A JavaScript library containing useful data structures and algorithms that are commonly used in coding interviews.
Installation
The interview.js package can be installed directly using npm.
npm install interview.jsUsage
Users can import common data structures and algorithms from several different modules. For example:
- To manually construct a binary tree, import the
TreeNodeclass from thetreesmodule:
let root = new TreeNode(2)
root.left = new TreeNode(1)
root.right = new TreeNode(3)- To construct a undirected graph adjacency list, import the
undirected_adj_listfunction from thegraphsmodule:
let edges = [('A', 'B'), ('A', 'C'), ('C', 'D')]
let adj_list = undirected_adj_list(edges)Documentation
The documentation is a work in progress, but contributions are welcome!