0.0.6 • Published 3 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.js
Usage
Users can import common data structures and algorithms from several different modules. For example:
- To manually construct a binary tree, import the
TreeNode
class from thetrees
module:
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_list
function from thegraphs
module:
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!