The Gateway to Computer Science Excellence
For all GATE CSE Questions
Toggle navigation
Facebook Login
or
Email or Username
Password
Remember
Login
Register

I forgot my password
Activity
Questions
Unanswered
Tags
Subjects
Users
Ask
Prev
Blogs
New Blog
Exams
Recent questions tagged identifyfunction
+2
votes
1
answer
1
CMI2019A9
The next two questions refer to the following program. In the code below reverse$(A,i,j)$ takes an array $A,$ indices $i$ and $j$ with $i\leq j,$ and reverses the segment $A[i],A[i+1],\cdots,A[j].$ ... } reverse(A,i,m); } return; } When the procedure terminates, the array A has been: Sorted in descending order Sorted in ascending order Reversed Left unaltered
asked
Sep 13, 2019
in
Programming
by
gatecse
Boss
(
17.5k
points)

135
views
cmi2019
identifyfunction
0
votes
2
answers
2
CMI2019A10
The next two questions refer to the following program. In the code below reverse$(A,i,j)$ takes an array $A,$ indices $i$ and $j$ with $i\leq j,$ and reverses the segment $A[i],A[i+1],\cdots,A[j].$ For instance if $A=[0,1,2,3,4,5,6,7]$ then, after we ... return; } The number of times the test $A[ j ] > A[ m ]$ is executed is: $4950$ $5050$ $10000$ Depends on the contents of $A$
asked
Sep 13, 2019
in
Programming
by
gatecse
Boss
(
17.5k
points)

79
views
cmi2019
identifyfunction
+2
votes
1
answer
3
CMI2018A10
What does the following function compute in terms of $n$ and $d$, for integer value of $n$ and $d,d>1?$ Note that $a//b$ denotes the quotient(integer part) of $a \div b,$ for integers $a$ and $b$. For instance $7//3$ is $2.$ function foo(n,d) ... $n.$ The number of digits in the base $d$ representation of $n.$ The number of ways of partitioning $n$ elements into groups of size $d.$
asked
Sep 13, 2019
in
Programming
by
gatecse
Boss
(
17.5k
points)

41
views
cmi2018
identifyfunction
+4
votes
8
answers
4
GATE201926
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 integer ... reverse order and terminate It will print the binary representation of $n$ but will not terminate It will not print anything and will not terminate
asked
Feb 7, 2019
in
Algorithms
by
Arjun
Veteran
(
430k
points)

4.6k
views
gate2019
algorithms
identifyfunction
0
votes
1
answer
5
GO2019FLT126
Consider the two given functions: int fun1(int x, int y) { if (y==0) return 0; return (x+fun2(x, y1)); } int fun2(int x, int y) { if (x==0) return y; return fun2(x1, x+y); } What will be the value returned by $\text{fun1}(4, 4)$ ____
asked
Dec 27, 2018
in
Algorithms
by
Ruturaj Mohanty
Active
(
2.7k
points)

115
views
go2019flt1
numericalanswers
identifyfunction
algorithms
+1
vote
1
answer
6
GO2019FLT129
Consider the following piece of code: int function(int a[], int n, int x) { int i; for (i=0; i<n && a[i]!=x;i++); if (i==n) return 1; else return i; } A function call is made with the arguments as follows: $a[]=\{5, 32, 1, 9, 7, 2\}$ $n=6$ $x=8$ What is the values returned by the above code?
asked
Dec 27, 2018
in
Algorithms
by
Ruturaj Mohanty
Active
(
2.7k
points)

125
views
go2019flt1
numericalanswers
identifyfunction
algorithms
0
votes
1
answer
7
#IdentifyFunctions #Algorithms User Gate 2014 Self Doubt
Original Question  here 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 + ... ============= Can someone trace the code by taking some arbitrary values in the array and show how to do this? Thank you!
asked
Jun 28, 2018
in
Algorithms
by
iarnav
Loyal
(
8.4k
points)

89
views
algorithms
usergate2014
usermod
identifyfunction
0
votes
2
answers
8
ISRO20187
Assume $A$ and $B$ are nonzero positive integers. The following code segment: while(A!=B){ if*(A> B) A = B; else B = A; } cout<<A; // printing the value of A Computes the $LCM$ of two numbers Divides the larger number by the smaller number Computes the $GCD$ of two numbers Finds the smaller of two numbers
asked
Apr 22, 2018
in
Algorithms
by
Arjun
Veteran
(
430k
points)

1.2k
views
isro2018
algorithms
identifyfunction
+1
vote
0
answers
9
gate 1994
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; convert the code in c
asked
Jun 14, 2017
in
Programming
by
Rameez Raza
Active
(
2.7k
points)

181
views
identifyfunction
+31
votes
7
answers
10
GATE2017243
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++) { if ( ... ; array[i1]) { swap(&array[i], &array[i1]); done =0; } } } printf( %d , array[3]); } The output of the program is _______
asked
Feb 14, 2017
in
Programming
by
Arjun
Veteran
(
430k
points)

5.4k
views
gate20172
programming
algorithms
numericalanswers
identifyfunction
+1
vote
1
answer
11
CMI2016A6
In the code fragment given below, $\mathsf{start}$ and $\mathsf{end}$ are integer values and $\mathsf{prime(x)}$ is a function that returns $\mathsf{true}$ if $\mathsf{x}$ is a prime number and $\mathsf{false}$ otherwise. i:=0; j:=0; k:=0; from (m := start; m <= end; m := m ... At the end of the loop: $k == ij.$ $k == ji.$ $k == ji.$ Depends on $\mathsf{start}$ and $\mathsf{end}$
asked
Dec 30, 2016
in
Programming
by
jothee
Veteran
(
105k
points)

46
views
cmi2016
identifyfunction
+5
votes
1
answer
12
TIFR2017A12
Consider the following program modifying an $n \times n$ square matrix $A$: for i=1 to n: for j=1 to n: temp=A[i][j]+10 A[i][j]=A[j][i] A[j][i]=temp10 end for end for Which of the following statements about the contents of matrix $A$ at the end of this program must ... $A$ is symmetric, that is, $A[i][j]=A[j][i]$ for all $1 \leq i, j \leq n$ $A$ remains unchanged
asked
Dec 22, 2016
in
Algorithms
by
jothee
Veteran
(
105k
points)

343
views
tifr2017
algorithms
identifyfunction
0
votes
2
answers
13
GATE19898a
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 type string= ... $s_{2}$  length obtained by concatenating $s_{1}$ with $s_{2}$ such that $s_{1}$ precedes $s_{2}$.
asked
Dec 3, 2016
in
Algorithms
by
makhdoom ghaya
Boss
(
30.7k
points)

228
views
gate1989
descriptive
algorithms
identifyfunction
+4
votes
3
answers
14
GATE199011b
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); }
asked
Nov 25, 2016
in
Algorithms
by
makhdoom ghaya
Boss
(
30.7k
points)

417
views
gate1990
descriptive
algorithms
identifyfunction
+7
votes
2
answers
15
GO2017Programming113
What is the following function doing? unsigned int foo(unsigned int x) { unsigned int c = sizeof x; c <<= 3; if(x == 0) return c; c; while(x = x & x1) c; return c; } Counting the number of bits in the ... x Counting the number of set bits in the binary representation of x Counting the number of unset bits in the binary representation of x None of the above
asked
Oct 19, 2016
in
Programming
by
Arjun
Veteran
(
430k
points)

510
views
go2017programming1
programming
identifyfunction
+3
votes
2
answers
16
GO2017Programming14
Consider the following C functions: int f1(int a, int b) { while (a != b) { if(a > b) a = a  b; else b = b  a; } return a; } int f2(int a, int b) { while (b != 0) { int t = b; b = a % b; a ... return same value for all positive inputs but not f3 For some positive input all 3 functions return different values f2 and f3 return same value for all positive inputs but not f1
asked
Oct 19, 2016
in
Programming
by
Arjun
Veteran
(
430k
points)

464
views
go2017programming1
programming
programminginc
identifyfunction
+4
votes
5
answers
17
ISRO201140
Consider the following pseudocode x:=1; i:=1; while ( x $\leq$ 500) begin x:=2$^x$; i:=i+1; end What is the value of i at the end of the pseudocode? 4 5 6 7
asked
Jun 22, 2016
in
Algorithms
by
jothee
Veteran
(
105k
points)

1.7k
views
isro2011
algorithms
identifyfunction
+6
votes
1
answer
18
ISRO200869
What is the value of F(4) using the following procedure: function F(K : integer) integer; begin if (k<3) then F:=k else F:=F(k1)*F(k2)+F(k3) end; 5 6 7 8
asked
Jun 13, 2016
in
Algorithms
by
jothee
Veteran
(
105k
points)

1.5k
views
isro2008
algorithms
recursion
identifyfunction
+5
votes
2
answers
19
ISRO200723
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
asked
Jun 10, 2016
in
Algorithms
by
jothee
Veteran
(
105k
points)

1.6k
views
isro2007
algorithms
identifyfunction
0
votes
1
answer
20
IISCCSAResearchTest4
What is the output of the following program? int main() { int i=0; do { if (i >=5) { i+=2; printf("%d \n", i); break; } else { printf("%d \n", ++i); continue; } } while (i<7); }
asked
Jun 8, 2016
in
Algorithms
by
jothee
Veteran
(
105k
points)

123
views
iisccsaresearch2016
descriptive
algorithms
identifyfunction
iiscinterview
+1
vote
1
answer
21
ISI2014PCBA1b
Let $x, y$ be two nonnegative integers $< 2^{32}$. By $x \wedge y$ we mean the integer represented by the bitwise logical $AND$ of the 32 bit binary representations of $x$ and $y$. For example, if $x = 13$ and $y = 6$, then $x \wedge y$ ... the pseudocode for the input $x = 13$? What will be the output of the pseudocode for an arbitrary nonnegative integer $x < 2^{32}$?
asked
May 30, 2016
in
Algorithms
by
jothee
Veteran
(
105k
points)

123
views
descriptive
isi2014
algorithms
identifyfunction
+1
vote
1
answer
22
CMI2011B07b
A finite sequence of bits is represented as a list with values from the set $\{0,1\}$for example, $[0,1,0], [1,0,1,1], \dots [ \: ]$ denotes the empty list, and $[b]$ is the list consisting of one bit $b$. For a nonempty list $l, \text{ head}(l)$ returns the first ... g2(n) if (n == 0) then return(0) else return f2(g2(n1),g1(n)) endif What is the value of $g2(256)$ and $g2(257)$?
asked
May 27, 2016
in
Algorithms
by
jothee
Veteran
(
105k
points)

80
views
descriptive
cmi2011
algorithms
identifyfunction
+7
votes
1
answer
23
CMI2010B07b
A finite sequence of bits is represented as a list with values from the set $\{0,1\}$. For example, $[0,1,0], [1,0,1,1], \dots [ \: ]$ denotes the empty list, and $[b]$ is the list consisting of one bit $b$. The function $\text{length}(l)$ ... mystery1(mystery2(s,tail(t)),mystery2(s,tail(t)))) endif Suppose $s=t=110100100$. What are the first two bits of $\text{mystery2(s,t)}$?
asked
May 27, 2016
in
Algorithms
by
jothee
Veteran
(
105k
points)

299
views
descriptive
cmi2010
algorithms
identifyfunction
+5
votes
1
answer
24
CMI2015B06b
Consider the code below, defining the functions $f$ and $g$: f(m, n) { if (m == 0) return n; else { q = m div 10; r = m mod 10; return f(q, 10*n + r); } } g(m, n) { if (n == 0) return m; else { q = m div 10; r = m mod 10; return g(f(f(q, 0), r), n1); } } What does $g(m, n)$ compute, for nonnegative numbers $m$ and $n$?
asked
May 27, 2016
in
Algorithms
by
jothee
Veteran
(
105k
points)

83
views
descriptive
cmi2015
algorithms
identifyfunction
+2
votes
1
answer
25
CMI2015B06a
Consider the code below, defining the functions $f$ and $g$: f(m, n) { if (m == 0) return n; else { q = m div 10; r = m mod 10; return f(q, 10*n + r); } } g(m, n) { if (n == 0) return m; else { q = m div 10; r = m mod 10; return g(f(f(q, 0), r), n1); } } Compute $g(3, 7), \: g(345, 1), \: g(345, 4) \text{ and } \: g(345, 0)$.
asked
May 27, 2016
in
Algorithms
by
jothee
Veteran
(
105k
points)

78
views
descriptive
cmi2015
algorithms
identifyfunction
+2
votes
0
answers
26
CMI2014B07c
Consider the code below, defining the function $A$: A(m, n, p) { if (p == 0) return m+n; else if (n == 0 && p == 1) return 0; else if (n == 0 && p == 2) return 1; else if (n == 0) return m; else return A(m, A(m,n1,p), p1); } Compute $A(2, 2, 3)$ and $A(2, 3, 3)$.
asked
May 27, 2016
in
Algorithms
by
jothee
Veteran
(
105k
points)

56
views
cmi2014
descriptive
algorithms
identifyfunction
+2
votes
1
answer
27
CMI2014B07b
Consider the code below, defining the function $A$: A(m, n, p) { if (p == 0) return m+n; else if (n == 0 && p == 1) return 0; else if (n == 0 && p == 2) return 1; else if (n == 0) return m; else return A(m, A(m,n1,p), p1); } Express $A(m, n, 2)$ as a function of $m$ and $n$.
asked
May 27, 2016
in
Algorithms
by
jothee
Veteran
(
105k
points)

62
views
cmi2014
descriptive
algorithms
identifyfunction
+3
votes
1
answer
28
CMI2014B07a
Consider the code below, defining the function $A$: A(m, n, p) { if (p == 0) return m+n; else if (n == 0 && p == 1) return 0; else if (n == 0 && p == 2) return 1; else if (n == 0) return m; else return A(m, A(m,n1,p), p1); } Express $A(m, n, 1)$ as a function of $m$ and $n$.
asked
May 27, 2016
in
Algorithms
by
jothee
Veteran
(
105k
points)

71
views
cmi2014
descriptive
algorithms
identifyfunction
+3
votes
2
answers
29
CMI2014A03
In the code fragment on the right, start and end are integer values and $\text{prime}(x)$ is a function that returns true if $x$ is a prime number and $\text{false}$ otherwise. At the end of the loop: i := 0; j := 0; k := 0; for (m := start; m <= end; m := m+1){ k := k + m ... + m; }else{ j := j + m; } } $k < i+j$ $k = i+j$ $k > i+j$ Depends on $\text{start}$ and $\text{end}$
asked
May 27, 2016
in
Algorithms
by
jothee
Veteran
(
105k
points)

77
views
cmi2014
algorithms
identifyfunction
Page:
1
2
3
next »
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
Recent Posts
ISRO CSE 2020 PAPER ANALYSE
BARC OCES/DGFS 2020
ISI CMI PDF by GATE Overflow
Management Trainee Recruitment COAL INDIA 2020
ECIL Interview Experience
Follow @csegate
Recent questions tagged identifyfunction
Recent Blog Comments
Hey all! I can't see the CS branch here? How...
it's depends year to year
What was the average cutoff that was maintained...
@Shivateja MST I don't think it will go high
http://univ.tifr.res.in/gs2020/Test_Results/INT_Sh...
50,741
questions
57,251
answers
198,044
comments
104,647
users