📚 Question Bank Q80 — Programming and Data Structure
Tags
Programming and Data Structure
Q80. Marks: +2.0 UGC NET Paper 2: Computer Science 26th Nov 2021

Consider the following recursive function F() in Java that takes an integer value and returns a string value :

public static String F(int N) {

if ( N <= 0) return "-";

return F(N - 3) + N + F(N - 2) + N;

}

The value of F(5) is :

1.-2-25-3-135
2.-2-25-1-3-135
3.-1-145-2-245
4.-2-25-3-1-135 ✓ Correct
📄 All “Programming and Data Structure” questions across papers
🏷 Change Tag for this Question