Skip to content

Commit 5446840

Browse files
committed
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

+2-2
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)