Skip to content

[박성빈] 7주차 제출합니다. #44

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

ImTotem
Copy link
Contributor

@ImTotem ImTotem commented Aug 25, 2024

트리에 익숙해진줄 알았는데 아니었어요

@ImTotem ImTotem self-assigned this Aug 25, 2024
Copy link
Collaborator

@Invidam Invidam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨어요~~

- 평균: $O(\log{(n)})$
- 최악: $O(N)$

- Space complexity: $$O(1)$$
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

# self.right = right
class Solution:
def isValidBST(self, root: TreeNode) -> bool:
stack, prev = [], float('-inf')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-inf라는 것도 있네요;;;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants