Frame
Dynamic Programming
상태 정의·전이·초기값을 구조화해 동적 계획법 사고 흐름을 빠르게 재현하기
Oct 2, 2025 — dynamic-programming
- base case
- 상태
- 선택
- 상태 전이 방정식
// base casedp[0][0][...] = base case
// state transferfor (const state1 of ALL_STATE1) { for (const stat2 of ALL_STATE2) { for (...) { dp[state1][state2][....] = calc_max(choice1, choice2, ...); } }}
- 상태 순회 순서는 초기값이 있는 위치와 최종 결과가 있는 위치를 고려하여 결정
- LeetCode’s Interview Crash Course: Data Structures and Algorithms (opens in a new window)
- 코딩 인터뷰를 위한 알고리즘 치트시트 (opens in a new window)