-
Notifications
You must be signed in to change notification settings - Fork 6
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
docs: BOJ 1992 쿼드트리 #40
Open
Parkjju
wants to merge
27
commits into
hufslion10th:main
Choose a base branch
from
Parkjju:1992
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…rs generate, 최신데이터 반영
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
BOJ 1992 쿼드트리
로직 개요
JavaScript / 링크 / BOJ / 재귀, 분할정복
1780 / 2630 문제와 동일한 풀이 방법입니다. 재귀에 분할정복을 적용하여 풀이합니다.
먼저 전체 요소를 순회하며 하나라도 서로 다른 값으로 이루어져 있으면 순회를 중단한 뒤 쿼드트리를 네 조각으로 분리하여 압축합니다.
쿼드트리 각 조각을 순회할때 재귀적으로 함수를 호출합니다.
왼쪽 위 / 오른쪽 위 / 왼쪽 아래 / 오른쪽 아래 각각의 조각을 돌며 압축 결과를
result
변수에 저장하고 네 조각에 대한 압축 결과를 자바스크립트 템플릿 리터럴 문법과 함께 괄호로 감싸 리턴합니다.결과
바킹독 문제집이 좋은게 특정 문제 유형을 주고 해당 유형을 익힐 수 있게 비슷한 문제들을 시리즈 느낌으로 제공해주네요 👍 재귀 + 분할정복 유형을 세 문제 연달아 풀이해보니 감이 잘 잡히는 느낌입니다.