Skip to content

Instantly share code, notes, and snippets.

View Axighi's full-sized avatar
💭
Rampaging

Azriel Axighi

💭
Rampaging
View GitHub Profile
@Axighi
Axighi / buildBinaryTreeFromArray.js
Last active April 20, 2021 02:48
Convert LeetCode Array Binary Tree To Tree Structure
// Definition for a binary tree node.
function TreeNode(val, left, right) {
this.val = val === undefined ? 0 : val;
this.left = left === undefined ? null : left;
this.right = right === undefined ? null : right;
}
/**
* @param {Array<Number>} nodes
* @return {null | TreeNode}