알고리즘 테스트 준비
2014-06-30 21:02:30

1. 변수 초기화 Gracefully

2. c 언어에서 시간 측정코드

clock_t before;

double result;

before = clock();

##DO WHATEVER I INTEND TO##

result = (double)(clock() - before) / CLOCKS_PER_SEC;

printf("Elapsed %5.3f secs

", result);

3. memoization 가능한 점화식 생성.

▼ more
jinx experiment
2014-06-28 12:50:13

for the first time

▼ more
내 삶의 대부분은 쉬는 시간이지만.
2014-06-28 12:48:32

뭔가 할 때는 왜 동시에 두 가지를 하고 싶은걸까..

한 가지로는 쉬는 시간을 방해받기 싫어서 인걸까 ㅎ

▼ more
Combination Ver.NoPrint
2014-06-27 23:33:39

이전에 Combination 함수는

최적화 문제를 푼것이 아니라 실제 답을 계산 하도록 한것이다.

만약 실제 값 출력하지 않는다면 parent 를 바로 이전 것만 알면된다. 초기 값은 0

/**

* Combination Ver.2

*/

#define N 4

#define R 2

void comb2(int parent,int depth){

    if(depth==R-1){

        return;

    }

    for(int i=parent+1;i<N;i++){

        comb2(i,depth+1);

    }

}

int main(){

    for(int i=0;i<N;i++){

        comb2(i,0);

    }

}

▼ more