임시저장소
정수로 나누는지 실수(double,float)로 나누는지 파악하자
class Solution { public int solution(int n) { double tmp =(double)n/7; // System.out.println("tmp = " + tmp); double result=Math.ceil(tmp); // System.out.println("result = " + result); return (int)result; } public static void main(String[] args) { Solution s = new Solution(); int n = 1; System.out.println(s.solution(n)); } }
재귀함수는 루트 노드가 된다.
▶깊이우선탐색(DFS)에서 재귀함수는 루트 노드가 된다!!!(매우 중요) ▶넓이우선탐색(BFS)에서 큐에서 popleft()을 한 노드는 부모노드가 된다.