Valid Foundations-of-Computer-Science Dumps shared by EduDump.com for Helping Passing Foundations-of-Computer-Science Exam! EduDump.com now offer the newest Foundations-of-Computer-Science exam dumps, the EduDump.com Foundations-of-Computer-Science exam questions have been updated and answers have been corrected get the newest EduDump.com Foundations-of-Computer-Science dumps with Test Engine here:
Which principle can be used to implement an algorithm to calculate factorial or Fibonacci sequence?
Correct Answer: C
Factorial and Fibonacci are classic examples used to teachrecursion, a technique where a function solves a problem by calling itself on smaller subproblems. The key requirement for recursion is (1) abase casethat stops further calls and (2) arecursive casethat reduces the problem size. For factorial, the definition is (n! = n \times (n-1)!) with base case (0! = 1) (or (1! = 1)). For Fibonacci, (F(n) = F(n-1) + F(n-2)) with base cases (F (0)=0) and (F(1)=1). These mathematical definitions map directly into recursive code, which is why textbooks frequently introduce recursion using these sequences. While factorial and Fibonacci can also be computed iteratively, the question asks for the principle that can be used to implement such algorithms, and recursion is the canonical textbook answer. Recursion also connects to important CS topics: call stacks, activation records, and divide-and-conquer problem solving. Option A ("procedural programming") and option D ("object-oriented programming") are broader paradigms rather than the specific technique used in the classic implementations. Option B ("iterative programming") is a valid alternative approach, but the standard instructional principle highlighted for these particular examples is recursion. Textbooks also note that naive recursive Fibonacci is inefficient (exponential time) unless optimized with memoization or converted to an iterative or dynamic programming approach.