-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(tree): Add the array representation of the binary tree(js,ts) #681
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
codes/javascript/modules/TreeNode.js
Outdated
if (node) { | ||
if (++i >= arr.length) break; | ||
if (arr[i] !== null) node.left = new TreeNode(arr[i]); | ||
if (++i >= arr.length) break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please match this function to other languages'(Java, C++, Python) implementation. We'd like to make the code consistent in terms of all the languages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, I've tested to make sure it's ok, please check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yuan0221 Thank you for clean code!
If this PR is related to coding or code translation, please fill out the checklist and paste the console outputs to the PR.