본문 바로가기
Biology/Terms

Memization

by 임은천 2013. 11. 8.

If the function C() is called with parameter i, and we have already computed C(i) once before, we will simply look up its value in the table and avoid spending a lot of running time (again). We will need to initialize the cells of this table with some dummy values that would tell us whether we have computed the value of that cell already or not. This technique is called memoization, and here is how it would change the code.


만약, 함수 C()가 파라미터 i로 호출되었을 때, 우리가 이미 C(i)를 이전에 계산했다면, 우리는 그것의 값을 계산하는데 오랜 시간을 (다시) 소비하는 대신에 테이블에서 검색하여 반환한다. 우리는 테이블의 셀 값들을 임의의 값으로 초기화 해서 해당 셀의 값이 이미 계산되었는지 여부를 판별할 것이다. 이 기술은 memoization이라고 부르고, 우리는 그에 따라 코드를 변경할 것이다.


출처: http://www.cs.cornell.edu/~wdtseng/icpc/notes/dp1.pdf

댓글