Question: Compute big O - JAVA please (the question is complete) int f(int m, int n) { if (m==1 || n==1) { return 1; } return

Compute big O - JAVA please (the question is complete) int f(int m, int n) { if (m==1 || n==1) { return 1; } return f(m, n-1) + f(m-1, n); } 

Input Format

M and N (in that order) separated by space, as inputs to the function:

Example: 3 4

Constraints

None

Output Format

One of the following

  • O(log n)
  • O(log m)
  • O(log(m+n))
  • O(log(m*n))
  • O(n)
  • O(m)
  • O(m+n)
  • O(m*n)
  • O(n log n)
  • O(m log m)
  • O(n log m)
  • O(m log n)
  • O((m+n) log(m+n))
  • O((m*n) log(m*n))
  • O(n^2)
  • O(m^2)
  • O((m+n)^2)
  • O((m*n)^2)
  • O(2^n)
  • O(2^m)
  • O(2^(m+n))
  • O(2^(m*n))

Sample Input 0

3 4 

Sample Output 0

O(2^(m+n)

Java code given:

import java.io.*; import java.util.*;

public class Solution {

public static void main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!