Don’t worry, unlock all articles / blogs on PrepInsta by just simply logging in on our website
Type atleast 3 characters
Popular Searches
Trending Pages
Notifications Mark All Read
No New notification
My Anatomy9>
PREPINSTA PRIME
Get Hiring Updates right in your inbox from PrepInsta
Question 1
int sum (int A[], int n){ int sum = 0, i; for (i = 0; i < n; i++) ------- line 1 sum = sum + A[i]; return sum; }
for ( i = 0 ; i > n ; i++ )
for ( int i = 0 ; i < =n ; i++ )
for ( i = 0 ; i < n ; ++i )
for ( i = 0 ; i > n ; )
Start
Question 2
function (input a, input b) if (a > b) return function (b, a) elseif (b != 0) return (a + function (a, b - 1)) else return 0 function(6,8)
48
50
52
68
Question 3
Input m = 12, n = 4 m = m - 1 ; n = n + 1 ; m = m + n ; n = n - 1 ; Print m,n
16,4
15,4
4,16
17,4
Question 4
Input i=8,j=9 Function ( i , j ) for x=1 to x=5 If i < j i++ Else j++ print( i, j )
10,11
11,10
11,11
10,10
Question 5
O(x)
O(1)
O(logx)
O(x^2)
Question 6
function(int n) if (n <= 1) return n return function(n-1) + function(n-2) End of function main () int n = 9 printf("%d", function(n)) return 0 End of main
32
34
30
28
Question 7
function (int n) { int a = 0, b = 1, c, i; if( n == 0) return a; for (i = 2; i <= n; i++) { c = a + b; a = b; b = c; } return b; } int main () { int n = 9; printf("%d", function(n)); return 0; }
O(log(n))
O(n)
O(n^2)
Question 8
public void func (Tree root) { func (root.left ()); func (root.right ()); System.out.println (root.data ()); }
Pre-order
In-order
Level-order
Post-order
Question 9
public void func (Tree root) { System.out.println (root.data ()); func (root.left ()); func (root.right ()); }
public void func (Tree root) { func (root.left ()); System.out.println (root.data ()); func (root.right ()); }
None of these
Question 10
initialize char c set c = ‘f’ print "%d",c
102
99
67
70
Please login to report