[Java] 분할정복, 백트레킹, 이진탐색
1. 분할 정복 Divide and Conquer 해결할 문제를 여러 작은 부분 문제로 나눈다. 나눈 작은 문제를 각각 해결한다. 접근법 Top-down approach bottom-up approach // Power 함수 import java.util.Scanner; // x^n을 O(logN) 시간복잡도로 구하는 분할 정복 알고리즘 public class SquareNumberTest { static int callCnt1; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int x = sc.nextInt(); int n = sc.nextInt(); // 최대 10억 System.out.println(exp1..
2024.02.19