Skip to content

Conversation

baexxbin
Copy link
Contributor

No description provided.

Comment on lines +21 to +34
Copy link
Contributor

Choose a reason for hiding this comment

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

DFS로 깔끔하게 구현해주신 것 같은데요,,!!

행과 열이 1,000이면서

RRRR ..... D
ULLL ..... D
RRRR ..... D
...
RRRR ..... L

이런 테스트 케이스에서는 스택 오버플로우가 발생할 것 같습니다!

질문 게시판에 반례 보고 댓글 남깁니다!

반례는 통과하지만, 행, 열 크기가 더 큰 경우에는 안될 것 같습니다!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

헉!!! 그렇군요!!
순환그래프는 dfs방법으로만 생각하고 시간복잡도도 괜찮아서 된다고 생각했었는데, 재귀일땐 스택 오버플로우도 잘 고려하는 습관을 길러야겠어요! N<=10^4 정도만 안전하다는 점... 잊지않도록 하겠습니당!! 알려주셔서 감사합니다!!😊

@KodaHye KodaHye merged commit 772d9c4 into main Feb 16, 2025
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