Skip to content
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

[Flynn] week4 #429

Merged
merged 5 commits into from
Sep 7, 2024
Merged

[Flynn] week4 #429

merged 5 commits into from
Sep 7, 2024

Conversation

obzva
Copy link
Contributor

@obzva obzva commented Sep 5, 2024

답안 제출 문제

체크 리스트

  • PR을 프로젝트에 추가하고 Week를 현재 주차로 설정해주세요.
  • 바로 앞에 PR을 열어주신 분을 코드 검토자로 지정해주세요.
  • 문제를 모두 푸시면 프로젝트에서 Status를 In Review로 설정해주세요.
  • 코드 검토자 1분 이상으로부터 승인을 받으셨다면 PR을 병합해주세요.

@obzva obzva marked this pull request as ready for review September 6, 2024 19:46
@obzva obzva requested a review from a team as a code owner September 6, 2024 19:46
Copy link
Contributor

@HC-kang HC-kang left a comment

Choose a reason for hiding this comment

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

@obzva 님 안녕하세요!
항상 코드나 풀이의 논리 전개가 깔끔해서 많이 배우고 있습니다~
이번 한 주도 고생하셨고 앞으로도 잘 부탁드립니다~!

*
* - Time complexity: O(M * N * 3 ^ W)
* - `exist`함수가 grid 원소 모두를 조회합니다 -> O(M * N)
* - 만약 `dfs`함수가 실행될 경우, 해당 함수는 최대 3방향에 대해 재귀호출을 실행합니다 (이전 좌표로는 `dfs`를 호출하지 않기 때문)
Copy link
Contributor

Choose a reason for hiding this comment

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

dfs가 종료조건에 의해 조기 종료 되더라도 호출 자체는 4방향으로 생각하는것이 맞지 않을까요?
특히 최초 요청의 경우에는 조기종료 없이 4방향으로 호출이 진행될텐데, 이부분을 3방향으로만 생각해도 될까 싶어서 의견드립니다!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

네 그럼 4 * 3^W 의 형태가 될텐데요, W의 크기가 증가함에 따라 3배씩 증가하니까 Big-O를 산정하는 관점에서는 O(3^W)로 보는 것이 맞다고 생각했습니다
이 부분은 저도 좀 더 준비해서 다음 시간에 발표해보겠습니다

Copy link
Contributor Author

Choose a reason for hiding this comment

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

만약 4방향으로 호출하더라도 1방향은 이미 방문했던 방향이기에 유의미한 연산을 진행하지 않는다고 생각했습니다
그래서 Big-O를 따질 땐 빠져야 한다고 생각했어요

@obzva obzva merged commit 7b991fd into DaleStudy:main Sep 7, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

2 participants