1. What is the possible output if this recursive function run if x is 5 and y is 2. static int fun1(int x, int y) { if (x == 0) return y; else return fun1(x - 1, x + y); }

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter15: Recursion
Section: Chapter Questions
Problem 8SA
icon
Related questions
Question
Question 2 1. What is the possible output if this recursive function run if x is 5 and y is 2. static int fun1(int x, int y) { if (x == 0) return y; else return fun1(x - 1, x + y); } 2. Calculate the big O notation for this function below. T(n) = 3n3 + 2n + 7
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Declaring and Defining the Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning