menu
Recent questions tagged identify-function
Login
Register
My account
Edit my Profile
Private messages
My favorites
Register
Recent questions tagged identify-function
All Activity
Q&A
Questions
Unanswered
Tags
Categories
Users
Ask a Question
Blogs
Previous Year
Recent questions tagged identify-function
0
votes
0
answers
671
views
GATE CSE 2021 Set 2 | Question: 23 | Video Solution
Arjun
asked
in
Algorithms
Feb 18, 2021
by
Arjun
1.4k
points
671
views
gate2021-cse-set2
numerical-answers
algorithms
identify-function
output
0
votes
0
answers
472
views
GATE CSE 2021 Set 1 | Question: 48 | Video Solution
Arjun
asked
in
Algorithms
Feb 18, 2021
by
Arjun
1.4k
points
472
views
gate2021-cse-set1
algorithms
numerical-answers
identify-function
0
votes
0
answers
47
views
GATE2015-2-11 Video Solution
Consider the following C function. int fun(int n) { int x=1, k; if (n==1) return x; for (k=1; k<n; ++k) x = x + fun(k) * fun (n-k); return x; } The return value of $fun(5)$ is ______.
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
47
views
gate2015-2
algorithms
identify-function
recurrence
normal
numerical-answers
video-solution
0
votes
0
answers
14
views
GATE2013-31 Video Solution
Consider the following function: int unknown(int n){ int i, j, k=0; for (i=n/2; i<=n; i++) for (j=2; j<=n; j=j*2) k = k + n/2; return (k); } The return value of the function is $\Theta(n^2)$ $\Theta(n^2\log n)$ $\Theta(n^3)$ $\Theta(n^3\log n)$
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
14
views
gate2013
algorithms
identify-function
normal
video-solution
0
votes
0
answers
20
views
GATE2017-2-43 Video Solution
Consider the following snippet of a C program. Assume that swap $(\&x, \&y)$ exchanges the content of $x$ and $y$: int main () { int array[] = {3, 5, 1, 4, 6, 2}; int done =0; int i; while (done==0) { done =1; for (i=0; i<=4; i++) ... [i-1]) { swap(&array[i], &array[i-1]); done =0; } } } printf( %d , array[3]); } The output of the program is _______
admin
asked
in
Programming
Apr 18, 2020
by
admin
589
points
20
views
gate2017-2
programming
algorithms
numerical-answers
identify-function
video-solution
0
votes
0
answers
43
views
GATE2019-26 Video Solution
Consider the following C function. void convert (int n ) { if (n<0) printf{ %d , n); else { convert(n/2); printf( %d , n%2); } } Which one of the following will happen when the function convert is called with any positive ... order and terminate It will print the binary representation of $n$ but will not terminate It will not print anything and will not terminate
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
43
views
gate2019
algorithms
identify-function
video-solution
0
votes
0
answers
16
views
GATE2015-1-31 Video Solution
Consider the following C function. int fun1 (int n) { int i, j, k, p, q = 0; for (i = 1; i < n; ++i) { p = 0; for (j = n; j > 1; j = j/2) ++p; for (k = 1; k < p; k = k * 2) ++q; } return q; } Which one of the following most closely approximates the return value of the function fun1? $n^3$ $n(\log n)^2$ $n \log n$ $n \log(\log n)$
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
16
views
gate2015-1
algorithms
normal
identify-function
video-solution
0
votes
0
answers
22
views
GATE2006-53 Video Solution
Consider the following C-function in which $a[n]$ and $b[m]$ are two sorted integer arrays and $c[n+m]$ be another integer array, void xyz(int a[], int b [], int c []){ int i,j,k; i=j=k=0; while ((i<n) && (j<m)) if (a[i] < b[j]) c[k++] = a[ ... $b[m-1]\leq a[i]$ if $j=m$ only (i) only (ii) either (i) or (ii) but not both neither (i) nor (ii)
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
22
views
gate2006
algorithms
identify-function
normal
video-solution
0
votes
0
answers
19
views
GATE2004-42 Video Solution
What does the following algorithm approximate? (Assume $m > 1, \epsilon >0$). x = m; y = 1; While (x-y > ϵ) { x = (x+y)/2; y = m/x; } print(x); $\log \, m$ $m^2$ $m^{\frac{1}{2}}$ $m^{\frac{1}{3}}$
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
19
views
gate2004
algorithms
identify-function
normal
video-solution
0
votes
0
answers
27
views
GATE2014-1-41 Video Solution
Consider the following C function in which size is the number of elements in the array E: int MyX(int *E, unsigned int size) { int Y = 0; int Z; int i, j, k; for(i = 0; i< size; i++) Y = Y + E[i]; for(i=0; i < size; ... in any sub-array of array E. sum of the maximum elements in all possible sub-arrays of array E. the sum of all the elements in the array E.
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
27
views
gate2014-1
algorithms
identify-function
normal
video-solution
0
votes
0
answers
17
views
GATE2014-2-10 Video Solution
Consider the function func shown below: int func(int num) { int count = 0; while (num) { count++; num>>= 1; } return (count); } The value returned by func($435$) is ________
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
17
views
gate2014-2
algorithms
identify-function
numerical-answers
easy
video-solution
0
votes
0
answers
19
views
GATE2003-88 Video Solution
In the following $C$ program fragment, $j$, $k$, $n$ and TwoLog_n are integer variables, and $A$ is an array of integers. The variable $n$ is initialized to an integer $\geqslant 3$, and TwoLog_n is initialized to the value of $2^*\lceil \log_2(n) \rceil$ for (k = 3; k ... $\left\{m \mid m \leq n, \text{m is prime} \right\}$ { }
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
19
views
gate2003
algorithms
identify-function
normal
video-solution
0
votes
0
answers
18
views
GATE1999-2.24 Video Solution
Consider the following $C$ function definition int Trial (int a, int b, int c) { if ((a>=b) && (c<b)) return b; else if (a>=b) return Trial(a, c, b); else return Trial(b, a, c); } The functional Trial: Finds the maximum of $a$, $b$, and $c$ Finds the minimum of $a$, $b$, and $c$ Finds the middle number of $a$, $b$, $c$ None of the above
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
18
views
gate1999
algorithms
identify-function
normal
video-solution
0
votes
0
answers
18
views
GATE1998-2.12 Video Solution
What value would the following function return for the input $x=95$? Function fun (x:integer):integer; Begin If x > 100 then fun = x – 10 Else fun = fun(fun (x+11)) End; $89$ $90$ $91$ $92$
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
18
views
gate1998
algorithms
recursion
identify-function
normal
video-solution
0
votes
0
answers
23
views
GATE2005-31 Video Solution
Consider the following C-program: void foo (int n, int sum) { int k = 0, j = 0; if (n == 0) return; k = n % 10; j = n/10; sum = sum + k; foo (j, sum); printf ("%d,",k); } int main() { int a = 2048, sum = 0; foo(a, sum); printf("%d\n", sum); } What ... print? $\text{8, 4, 0, 2, 14}$ $\text{8, 4, 0, 2, 0}$ $\text{2, 0, 4, 8, 14}$ $\text{2, 0, 4, 8, 0}$
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
23
views
gate2005
algorithms
identify-function
recursion
normal
video-solution
0
votes
0
answers
18
views
GATE2014-3-10 Video Solution
Let $A$ be the square matrix of size $n \times n$. Consider the following pseudocode. What is the expected output? C=100; for i=1 to n do for j=1 to n do { Temp = A[i][j]+C; A[i][j] = A[j][i]; A[j][i] = Temp - ... $A$ itself Transpose of the matrix $A$ Adding $100$ to the upper diagonal elements and subtracting $100$ from lower diagonal elements of $A$ None of the above
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
18
views
gate2014-3
algorithms
identify-function
easy
video-solution
0
votes
0
answers
15
views
GATE2003-1 Video Solution
Consider the following $C$ function. For large values of $y$, the return value of the function $f$ best approximates float f,(float x, int y) { float p, s; int i; for (s=1,p=1,i=1; i<y; i++) { p *= x/i; s += p; } return s; } $x^y$ $e^x$ $\text{ln} (1+x)$ $x^x$
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
15
views
gate2003
algorithms
identify-function
normal
video-solution
0
votes
0
answers
34
views
GATE2009-18 Video Solution
Consider the program below: #include <stdio.h> int fun(int n, int *f_p) { int t, f; if (n <= 1) { *f_p = 1; return 1; } t = fun(n-1, f_p); f = t + *f_p; *f_p = t; return f; } int main() { int x = 15; printf("%d/n", fun(5, &x)); return 0; } The value printed is: $6$ $8$ $14$ $15$
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
34
views
gate2009
algorithms
recursion
identify-function
normal
video-solution
0
votes
0
answers
26
views
GATE2000-2.15 Video Solution
Suppose you are given an array $s[1....n]$ and a procedure reverse $(s, i, j)$ which reverses the order of elements in $s$ between positions $i$ and $j$ (both inclusive). What does the following sequence do, where $1 \leqslant k \leqslant n$: ... reverse (s, 1, n); Rotates $s$ left by $k$ positions Leaves $s$ unchanged Reverses all elements of $s$ None of the above
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
26
views
gate2000
algorithms
normal
identify-function
video-solution
0
votes
0
answers
16
views
GATE2010-35 Video Solution
What is the value printed by the following C program? #include<stdio.h> int f(int *a, int n) { if (n <= 0) return 0; else if (*a % 2 == 0) return *a+f(a+1, n-1); else return *a - f(a+1, n-1); } int main() { int a[] = (12, 7, 13, 4, 11, 6); printf("%d", f(a, 6)); return 0; } $-9$ $5$ $15$ $19$
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
16
views
gate2010
algorithms
recursion
identify-function
normal
video-solution
0
votes
0
answers
18
views
GATE2015-3-49 Video Solution
Suppose $c = \langle c[0], \dots, c[k-1]\rangle$ is an array of length $k$, where all the entries are from the set $\{0, 1\}$. For any positive integers $a \text{ and } n$, consider the following pseudocode. DOSOMETHING (c, a, n) $z \leftarrow 1$ ... , then the output of DOSOMETHING(c, a, n) is _______.
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
18
views
gate2015-3
algorithms
identify-function
normal
numerical-answers
video-solution
0
votes
0
answers
20
views
GATE2006-IT-52 Video Solution
The following function computes the value of $\binom{m}{n}$ correctly for all legal values $m$ and $n$ ($m ≥1, n ≥ 0$ and $m > n$) int func(int m, int n) { if (E) return 1; else return(func(m -1, n) + func(m - 1, n - 1)); } In the above function, which of the following is ... $(m = = 1)$ $(n = = 0) || (m = = n)$ $(n = = 0)$ && $(m = = n)$
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
20
views
gate2006-it
algorithms
identify-function
normal
video-solution
0
votes
0
answers
17
views
GATE2008-IT-83 Video Solution
Consider the code fragment written in C below : void f (int n) { if (n <= 1) { printf ("%d", n); } else { f (n/2); printf ("%d", n%2); } } Which of the following implementations will produce the same output for $f(173)$ as the above code? ... { printf ("%d", n%2); f (n/2); } } Both $P1$ and $P2$ $P2$ only $P1$ only Neither $P1$ nor $P2$
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
17
views
gate2008-it
algorithms
recursion
identify-function
normal
video-solution
0
votes
0
answers
40
views
GATE1998-2.13 Video Solution
What is the result of the following program? program side-effect (input, output); var x, result: integer; function f (var x:integer:integer; begin x:x+1;f:=x; end begin x:=5; result:=f(x)*f(x); writeln(result); end $5$ $25$ $36$ $42$
admin
asked
in
Programming
Apr 18, 2020
by
admin
589
points
40
views
gate1998
programming
normal
identify-function
video-solution
0
votes
0
answers
21
views
GATE2011-48 Video Solution
Consider the following recursive C function that takes two arguments. unsigned int foo(unsigned int n, unsigned int r) { if (n>0) return ((n%r) + foo(n/r, r)); else return 0; } What is the return value of the function $\text{foo}$ when it is called as $\text{foo(345, 10)}$? $345$ $12$ $5$ $3$
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
21
views
gate2011
algorithms
recursion
identify-function
normal
video-solution
0
votes
0
answers
17
views
GATE2004-41 Video Solution
Consider the following C program main() { int x, y, m, n; scanf("%d %d", &x, &y); /* Assume x>0 and y>0*/ m = x; n = y; while(m != n) { if (m > n) m = m-n; else n = n-m; } printf(" ... $x+y$ using repeated subtraction $x \mod y$ using repeated subtraction the greatest common divisor of $x$ and $y$ the least common multiple of $x$ and $y$
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
17
views
gate2004
algorithms
normal
identify-function
video-solution
0
votes
0
answers
16
views
GATE2004-IT-15 Video Solution
Let $x$ be an integer which can take a value of $0$ or $1$. The statement if (x == 0) x = 1; else x = 0; is equivalent to which one of the following ? $x = 1 + x;$ $x = 1 - x;$ $x = x - 1;$ $x = 1\% x;$
admin
asked
in
Programming
Apr 18, 2020
by
admin
589
points
16
views
gate2004-it
programming
easy
identify-function
video-solution
0
votes
0
answers
14
views
GATE2005-IT-57 Video Solution
What is the output printed by the following program? #include <stdio.h> int f(int n, int k) { if (n == 0) return 0; else if (n % 2) return f(n/2, 2*k) + k; else return f(n/2, 2*k) - k; } int main () { printf("%d", f(20, 1)); return 0; } $5$ $8$ $9$ $20$
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
14
views
gate2005-it
algorithms
identify-function
normal
video-solution
0
votes
0
answers
17
views
GATE2006-50 Video Solution
A set $X$ can be represented by an array $x[n]$ as follows: $x\left [ i \right ]=\begin {cases} 1 & \text{if } i \in X \\ 0 & \text{otherwise} \end{cases}$ Consider the following algorithm in which $x$, $y$, and $z$ are Boolean arrays of size $n$: algorithm zzz ... set $Z$ computed by the algorithm is: $(X\cup Y)$ $(X\cap Y)$ $(X-Y)\cap (Y-X)$ $(X-Y)\cup (Y-X)$
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
17
views
gate2006
algorithms
identify-function
normal
video-solution
0
votes
0
answers
19
views
GATE2008-IT-82 Video Solution
Consider the code fragment written in C below : void f (int n) { if (n <=1) { printf ("%d", n); } else { f (n/2); printf ("%d", n%2); } } What does f(173) print? $010110101$ $010101101$ $10110101$ $10101101$
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
19
views
gate2008-it
algorithms
recursion
identify-function
normal
video-solution
0
votes
0
answers
18
views
GATE2011-49 Video Solution
Consider the following recursive C function that takes two arguments. unsigned int foo(unsigned int n, unsigned int r) { if (n>0) return ((n%r) + foo(n/r, r)); else return 0; } What is the return value of the function $\text{foo}$ when it is called as $\text{foo(513, 2)}$? $9$ $8$ $5$ $2$
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
18
views
gate2011
algorithms
recursion
identify-function
normal
video-solution
0
votes
0
answers
48
views
GATE1995-3 Video Solution
Consider the following high level programming segment. Give the contents of the memory locations for variables $W, X, Y$ and $Z$ after the execution of the program segment. The values of the variables $A$ and $B$ are $5CH$ and $92H$, respectively. Also indicate error conditions if ... integer is represented by two bytes) begin X :=A+B Y :=abs(A-B); W :=A-B Z :=A*B end;
admin
asked
in
Programming
Apr 18, 2020
by
admin
589
points
48
views
gate1995
programming
identify-function
descriptive
video-solution
0
votes
0
answers
20
views
GATE1995-2.3 Video Solution
Assume that $X$ and $Y$ are non-zero positive integers. What does the following Pascal program segment do? while X <> Y do if X > Y then X := X - Y else Y := Y - X; write(X); Computes the LCM of two numbers Divides the larger number by the smaller number Computes the GCD of two numbers None of the above
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
20
views
gate1995
algorithms
identify-function
normal
video-solution
0
votes
0
answers
18
views
GATE1991-03-viii Video Solution
Choose the correct alternatives (more than one may be correct) and write the corresponding letters only: Consider the following Pascal function: Function X(M:integer):integer; Var i:integer; Begin i := 0; while i*i < M do i:= i+1 X := i end The function ... $\lfloor\sqrt N \rfloor +1$ $\lceil \sqrt N \rceil$ $\lceil \sqrt N \rceil +1$ None of the above
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
18
views
gate1991
algorithms
easy
identify-function
video-solution
0
votes
0
answers
16
views
GATE1995-1.4 Video Solution
In the following Pascal program segment, what is the value of X after the execution of the program segment? X := -10; Y := 20; If X > Y then if X < 0 then X := abs(X) else X := 2*X; $10$ $-20$ $-10$ None
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
16
views
gate1995
algorithms
identify-function
easy
video-solution
0
votes
0
answers
15
views
GATE1995-4 Video Solution
Consider the following Pascal function where $A$ and $B$ are non-zero positive integers. What is the value of $GET(3, 2)$? function GET(A,B:integer): integer; begin if B=0 then GET:= 1 else if A < B then GET:= 0 else GET:= GET(A-1, B) + GET(A-1, B-1) end; The Pascal procedure ... N - 1 do for J:=1 to N do begin TMP:= A[I, J]; A[I, J]:= A[J, I]; A[J, I]:= TMP end end;
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
15
views
gate1995
algorithms
identify-function
normal
video-solution
0
votes
0
answers
23
views
GATE1994-6 Video Solution
What function of $x$, $n$ is computed by this program? Function what(x, n:integer): integer: Var value : integer begin value := 1 if n > 0 then begin if n mod 2 =1 then value := value * x; value := value * what(x*x, n div 2); end; what := value; end;
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
23
views
gate1994
algorithms
identify-function
normal
video-solution
0
votes
0
answers
18
views
GATE1993-7.4 Video Solution
What does the following code do? var a, b: integer; begin a:=a+b; b:=a-b; a:a-b; end; exchanges $a$ and $b$ doubles $a$ and stores in $b$ doubles $b$ and stores in $a$ leaves $a$ and $b$ unchanged none of the above
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
18
views
gate1993
algorithms
identify-function
easy
video-solution
0
votes
0
answers
13
views
GATE1990-11b Video Solution
The following program computes values of a mathematical function $f(x)$. Determine the form of $f(x)$. main () { int m, n; float x, y, t; scanf ("%f%d", &x, &n); t = 1; y = 0; m = 1; do { t *= (-x/m); y += t; } while (m++ < n); printf ("The value of y is %f", y); }
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
13
views
gate1990
descriptive
algorithms
identify-function
video-solution
0
votes
0
answers
25
views
GATE1989-8a Video Solution
What is the output produced by the following program, when the input is "HTGATE" Function what (s:string): string; var n:integer; begin n = s.length if n <= 1 then what := s else what :=contact (what (substring (s, 2, n)), s.C [1]) end; Note ... $s_{2}$ - length obtained by concatenating $s_{1}$ with $s_{2}$ such that $s_{1}$ precedes $s_{2}$.
admin
asked
in
Algorithms
Apr 18, 2020
by
admin
589
points
25
views
gate1989
descriptive
algorithms
identify-function
video-solution
To see more, click for the
full list of questions
or
popular tags
.
Ask a Question
Quick search syntax
tags
tag:apple
author
user:martin
title
title:apple
content
content:apple
exclude
-tag:apple
force match
+apple
views
views:100
score
score:10
answers
answers:2
is accepted
isaccepted:true
is closed
isclosed:true
Welcome to GATE CSE Doubts, where you can ask questions and receive answers from other members of the community.
Recent Posts
New GATEOverflow PDFs
Guidelines to users
No Recent Blog Comments
Search GATE CSE Video Solutions