-
[JS 알고리즘&자료구조] 문제 해결 패턴 소개JavaScript/Basic 2023. 11. 2. 23:09
어려운 문제를 맞닥뜨리게 되면 어떻게 해야할까? 아무런 대처법을 알지 못하는 상황이라면 머리가 새하얘질 것이고 어찌 저찌 문제 해결을 위한 첫 삽을 뜬다고 하더라도 도중에 어그러지면 패닉에 빠지기 쉽다. 그렇기에 우리는 문제 해결을 위한 방법들을 잘 숙지하고 있어야 한다.
문제를 해결하기 위한 방법에는 2가지가 있다. 아래를 보자
- 문제를 해결하기 위한 세밀한 계획을 세운다 (앞선 섹터에서 진행함)
- 일반적인 문제 해결 패턴을 습득한다.
이번 섹터에서는 몇 가지 문제 해결 패턴들을 살펴볼 예정이다. 문제 해결 패턴은 문제 해결을 위한 일반적인 접근법이라고 보면 된다. 접근법이지 해결법이 아니기 때문에 모든 문제를 풀 수 있는 만능 열쇠 같은 것이 아니다. 그저 프로그래밍 매커니즘이나 청사진 정도로 생각하면 될 것이다.
다음 장에서 빈도수 카운터라 불리는 패턴부터 살펴보도록 하자.
'JavaScript > Basic' 카테고리의 다른 글
[JS 알고리즘&자료구조] 빈도수 세기 : 애너그램 도전 과제 (0) 2023.11.07 [JS 알고리즘&자료구조] 빈도수 세기 패턴 (0) 2023.11.03 [JS 알고리즘&자료구조] 되돌아보기와 리팩터 (0) 2023.11.02 [JS 알고리즘&자료구조] 해결 또는 단순화 (0) 2023.11.01 [JS 알고리즘&자료구조] 세부 분석 (1) 2023.10.31