Recursive program to raise an integer x to power y uses which of the following algorithm?

Minh Tung

New member
Recursive program to raise an integer x to power y uses which of the following algorithm?
A. Dynamic programming
B. Backtracking
C. Divide and conquer
D. Greedy algorithm
 
Answer: C
Explanation: The recursive approach uses divide and conquer algorithm as we break the problem into smaller parts and then solve the smaller parts and finally combine their results to get the overall solution.
 

Tìm kiếm

Back
Top