개발정보/DataStructure&Algorithm

01_Recursive Call (Recalling oneself inside a function)

코리안던 2020. 12. 20.

#include <stdio.h>

void recursive_func(int n){

  if(n==0) return;

  printf("before call : %d \n",n);

  recursive_func(n-1);

  printf("after call : %d \n", n);

}

 

void main(){

  recursive_func(3);

}

 

결과

'개발정보 > DataStructure&Algorithm' 카테고리의 다른 글

02_Stack structure 응용_Maze Escape with Stack  (0) 2020.12.23
01_Stack structure개념과 구현  (0) 2020.12.22
시간복잡도  (0) 2020.12.22
02_Recursive call Factorials  (0) 2020.12.20

댓글