Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5446840

Browse files
Binary tree right side view - update big o notation
1 parent 6523893 commit 5446840

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎0199_binaryTreeRightSideView.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
* @return {number[]} List of nodes for right side of tree, ordered top to bottom.
1414
* @summary Binary Tree Right Side View {@link https://leetcode.com/problems/binary-tree-right-side-view/}
1515
* @description Given a binary tree, return right side of it, ordered.
16-
* Space O(1) -
17-
* Time O(n) -
16+
* Space O(n) - up to diameter of tree (n/2) in queue at once.
17+
* Time O(n) - traverse each tree element.
1818
*/
1919
const rightSideView = root => {
2020
let current = [];

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /