-
-
Save njofce/a1b8b937f57e0a199279ea41da0169ed to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| getFlatTree(): TreeNode[] { | |
| return this.flatTreeRecursive(this._root); | |
| } | |
| private flatTreeRecursive(root: TreeNode): TreeNode[] { | |
| let res = []; | |
| for (let c of root.children) { | |
| res.push(c); | |
| res = res.concat(this.flatTreeRecursive(c)); | |
| } | |
| return res; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment