Converts a tree from BFS layout to inorder layout
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
README.md
bfs2inorder.js
package.json

README.md

bfs2inorder

Converts an index in bfs order to an inorder index.

Install

npm install bfs2inorder

Use

var bfs2inorder = require("bfs2inorder")

console.log(bfs2inorder(10, 3))

require("bfs2inorder")(n, x)

Returns the index of a node at position x in a bfs tree in an inorder traversal of the tree.

Credits

(c) 2013 Mikola Lysenko. MIT License