Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Search results for function
42
votes
5
answers
1
GATE CSE 2013 | Question: 31
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)$
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 functio...
Arjun
29.5k
views
Arjun
asked
Sep 24, 2014
Algorithms
gatecse-2013
algorithms
identify-function
normal
+
–
62
votes
12
answers
2
GATE CSE 2015 Set 2 | Question: 11
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 ______.
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)$...
go_editor
21.2k
views
go_editor
asked
Feb 12, 2015
Algorithms
gatecse-2015-set2
algorithms
identify-function
recurrence-relation
normal
numerical-answers
+
–
57
votes
7
answers
3
GATE CSE 2015 Set 1 | Question: 31
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 $\text{fun1}$? $n^3$ $n(\log n)^2$ $n \log n$ $n \log(\log n)$
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)...
makhdoom ghaya
20.8k
views
makhdoom ghaya
asked
Feb 13, 2015
Algorithms
gatecse-2015-set1
algorithms
normal
identify-function
+
–
33
votes
6
answers
4
GATE CSE 2004 | Question: 42
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}}$
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}{...
Kathleen
14.3k
views
Kathleen
asked
Sep 18, 2014
Algorithms
gatecse-2004
algorithms
identify-function
normal
+
–
56
votes
7
answers
5
GATE CSE 2003 | Question: 88
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\}$ { }
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 $\...
Kathleen
12.3k
views
Kathleen
asked
Sep 17, 2014
Algorithms
gatecse-2003
algorithms
identify-function
normal
+
–
54
votes
7
answers
6
GATE CSE 2017 Set 2 | Question: 43
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 _______
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...
Arjun
17.1k
views
Arjun
asked
Feb 14, 2017
Programming in C
gatecse-2017-set2
programming
algorithms
numerical-answers
identify-function
+
–
11
votes
4
answers
7
GATE CSE 2021 Set 2 | Question: 23
Consider the following $\text{ANSI C}$ function: int SomeFunction (int x, int y) { if ((x==1) || (y==1)) return 1; if (x==y) return x; if (x > y) return SomeFunction(x-y, y); if (y > x) return SomeFunction (x, y-x); } The value returned by $\textrm{SomeFunction(15, 255)}$ is __________
Consider the following $\text{ANSI C}$ function:int SomeFunction (int x, int y) { if ((x==1) || (y==1)) return 1; if (x==y) return x; if (x y) return SomeFunction(x-y, y...
Arjun
5.1k
views
Arjun
asked
Feb 18, 2021
Algorithms
gatecse-2021-set2
numerical-answers
algorithms
identify-function
output
1-mark
+
–
18
votes
4
answers
8
GATE CSE 2020 | Question: 48
Consider the following C functions. int tob (int b, int* arr) { int i; for (i = 0; b>0; i++) { if (b%2) arr [i] = 1; else arr[i] = 0; b = b/2; } return (i); } int pp(int a, int b) { int arr[20]; int i, tot = 1, ex, len; ex = a; len = tob(b ... ; i<len ; i++) { if (arr[i] ==1) tot = tot * ex; ex= ex*ex; } return (tot) ; } The value returned by $pp(3,4)$ is _______.
Consider the following C functions.int tob (int b, int* arr) { int i; for (i = 0; b>0; i++) { if (b%2) arr [i] = 1; else arr[i] = 0; b = b/2; } ret...
Arjun
11.4k
views
Arjun
asked
Feb 12, 2020
Algorithms
gatecse-2020
numerical-answers
identify-function
2-marks
+
–
5
votes
1
answer
9
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 17
Consider the following function. If $n$ and $\mathrm{k}$ are positive integers, then the least value of $\mathrm{k}$ such that $\mathrm{f}(\mathrm{k})>n$ is approximately $\log _2\left(\log _2 n\right)$ $\log _2 n$ $n \log _2 n$ $2^n$
Consider the following function.If $n$ and $\mathrm{k}$ are positive integers, then the least value of $\mathrm{k}$ such that $\mathrm{f}(\mathrm{k})>n$ is approximately$...
GO Classes
500
views
GO Classes
asked
Feb 5
Algorithms
goclasses2024-mockgate-14
algorithms
identify-function
time-complexity
1-mark
+
–
5
votes
1
answer
10
GO Classes Test Series 2024 | Mock GATE | Test 12 | Question: 30
Consider the following pseudocode for a function that operates on an $\textsf{N}$ element array $\textsf{A[1],A[2]},\dots,\textsf{A[N]}$ of integers. function mystery (A[1...N]) { int i,j,position,tmp; for i=1 to N { position= ... ; } } If $\textsf{N = 100,}$ how many times is the comparison $\textsf{A[j] < A[position]}$ checked?
Consider the following pseudocode for a function that operates on an $\textsf{N}$ element array $\textsf{A ,A },\dots,\textsf{A[N]}$ of integers.function mystery (A[1...N...
GO Classes
524
views
GO Classes
asked
Jan 21
Algorithms
goclasses2024-mockgate-12
goclasses
numerical-answers
algorithms
identify-function
time-complexity
2-marks
+
–
8
votes
4
answers
11
GATE CSE 2021 Set 1 | Question: 48
Consider the following $\text{ANSI C}$ function: int SimpleFunction(int Y[], int n, int x) { int total = Y[0], loopIndex; for (loopIndex=1; loopIndex<=n-1; loopIndex++) total=x*total +Y[loopIndex]; return total; } Let $\textsf{Z}$ be an array ... $i$ such that $0 \leq i \leq 9$. The value returned by $\textsf{SimpleFunction(Z},10,2)$ is __________
Consider the following $\text{ANSI C}$ function:int SimpleFunction(int Y[], int n, int x) { int total = Y[0], loopIndex; for (loopIndex=1; loopIndex<=n-1; loopIndex++) to...
Arjun
6.2k
views
Arjun
asked
Feb 18, 2021
Algorithms
gatecse-2021-set1
algorithms
numerical-answers
identify-function
2-marks
+
–
42
votes
5
answers
12
GATE CSE 2003 | Question: 60, ISRO2007-45
A program consists of two modules executed sequentially. Let $f_1(t)$ and $f_2(t)$ ... $\int_0^t f_1(x)f_2(t-x)dx$ $\max\{f_1(t),f_2(t)\}$
A program consists of two modules executed sequentially. Let $f_1(t)$ and $f_2(t)$ respectively denote the probability density functions of time taken to execute the two ...
Kathleen
9.2k
views
Kathleen
asked
Sep 17, 2014
Probability
gatecse-2003
probability
normal
isro2007
probability-density-function
+
–
0
votes
1
answer
13
function call
int foo(int n){ if(n<3) return 1; else return (foo(n-1) + foo(n-3) + 1); } Let ‘m’ denote the number of invocations of function foo and ‘n’ denote the return value when the function is called as foo(foo(5)). What is the value of m - n ?
int foo(int n){if(n<3)return 1;else return (foo(n-1) + foo(n-3) + 1);}Let ‘m’ denote the number of invocations of function foo and ‘n’ denote the return val...
24aaaa23
273
views
24aaaa23
asked
Oct 1, 2023
Algorithms
algorithms
identify-function
normal
+
–
1
votes
1
answer
14
TIFR CSE 2022 | Part B | Question: 4
Consider the following algorithm for computing the factorial of a positive integer $n$, specified in binary: prod ← 1 for i from 1 to n prod ← prod i output prod Assume that the number of bit operations required to multiply a $k$-bit positive integer with an $\ell$ ... $\omega(n \log n)$ $O\left(n^3\right)$ but $\omega\left(n^2\right) $ None of the above
Consider the following algorithm for computing the factorial of a positive integer $n$, specified in binary:prod ← 1 for i from 1 to n prod ← prod × i output prodAss...
admin
676
views
admin
asked
Sep 1, 2022
Algorithms
tifr2022
algorithms
identify-function
time-complexity
+
–
1
votes
1
answer
15
DRDO CSE 2022 Paper 2 | Question: 32
A perceptron consists of weights $\left[w_{1}, w_{2}, w_{3}, w_{4}\right]=[0.5,2,1,-3]$. The activation function is provided as $y=f(z)=1$ if $z \geq 2$ otherwise $0,$ where $z= \sum(w . d)$. What is the output $y$ ...
A perceptron consists of weights $\left[w_{1}, w_{2}, w_{3}, w_{4}\right]=[0.5,2,1,-3]$. The activation function is provided as $y=f(z)=1$ if $z \geq 2$ otherwise $0,$ wh...
admin
402
views
admin
asked
Dec 15, 2022
Artificial Intelligence
drdocse-2022-paper2
artificial-intelligence
activation-function
5-marks
descriptive
+
–
6
votes
1
answer
16
GO Classes 2023 | IIITH Mock Test 1 | Question: 50
For which of the following functions $f(n)$ and $g(n),$ it holds $:f(n)=O(g(n)).$ Every $\log$ below is base $2.$ $f(n)=2^{k \log n}\;, \quad g(n)=n^k$ $f(n)=2^n\;, \quad g(n)=2^{2 n}$ ... $f(n)=2^{\sqrt{\log n}}\;, \quad g(n)= (\log n)^{100}$
For which of the following functions $f(n)$ and $g(n),$ it holds $:f(n)=O(g(n)).$ Every $\log$ below is base $2.$$f(n)=2^{k \log n}\;, \quad g(n)=n^k$$f(n)=2^n\;, \quad g...
GO Classes
952
views
GO Classes
asked
Mar 26, 2023
Algorithms
goclasses2023-iiith-mock-1
goclasses
algorithms
logarithmic-function
asymptotic-notation
multiple-selects
1-mark
+
–
29
votes
6
answers
17
GATE CSE 1998 | Question: 2.12
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$
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;$...
Kathleen
13.9k
views
Kathleen
asked
Sep 25, 2014
Algorithms
gate1998
algorithms
recursion
identify-function
normal
+
–
23
votes
8
answers
18
GATE CSE 2019 | Question: 26
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
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 hap...
Arjun
16.7k
views
Arjun
asked
Feb 7, 2019
Algorithms
gatecse-2019
algorithms
identify-function
2-marks
+
–
5
votes
2
answers
19
GATE CSE 2014 Set 2 | Question: 10 | Modified
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: 6 9 Will loop forever Depends on computer architecture
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:69Will ...
Souvik33
1.1k
views
Souvik33
asked
Jan 15, 2023
Programming in C
algorithms
identify-function
numerical-answers
easy
+
–
5
votes
3
answers
20
ISRO2007-23
Study the following program //precondition: x>=0 public void demo(int x) { System.out.print(x % 10); if (x % 10 != 0) { demo(x/10); } System.out.print(x%10); } Which of the following is printed as a result of the call demo $(1234)$? $1441$ $3443$ $12344321$ $43211234$
Study the following program//precondition: x>=0 public void demo(int x) { System.out.print(x % 10); if (x % 10 != 0) { demo(x/10); } System.out.print(x%10); }Which of the...
go_editor
3.7k
views
go_editor
asked
Jun 10, 2016
Algorithms
isro2007
algorithms
identify-function
+
–
Page:
1
2
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register