Professional Documents
Culture Documents
Acc PDF All Mcqs
Acc PDF All Mcqs
Question 1
What will be the output of the following pseudocode ?
Int a=9,b=7,c=8,d=4,e
e=a+b+c+d/4
if(e>5)
print “PASS”
A: 1
else
B: PASS
print “FAIL”
C: FAIL
D: 0
Question 2
Integer a=3,b=2
if(a+b<7)
a=a*0+b
else
for i=1 to 4
a=a+i
End for loop A: 2 3
Print a, b+1 B: None of the mentioned options
C: 4 3
D: 3 3
Question 3
What will be the output of the following pseudocode?
int p=2,q=6,r=9,I
if(r>p+q)
for i=1 to 3
p=p+q
q=q+1 A: 32 10 22
end for B: 23 9 9
r=p-q C: 15 8 7
print p,q,r D: 23 9 14
Question 4
What will be the output of the following pseudocode?
int a=15,b=45,c=9, I
if((c>(a+b) OR a< (5*c))
for i =1 to 3
c=c*2
Else A: 48,9
while(a>6) B: 45, 72
b=b+1 C: 45,9
a=a-4 D: 41,4
end while
Print b,c
Question 5
What will be the output of the following pseudocode?
fun(int a)
if(a<1)
return
else
A: 1 2
print a
B: 3 2 1 1 2 3
fun(a-1)
C: 2 1 1 2
print a
D: 2 1
return
Question 6
What will be the output of the following pseudocode if the value of n1
and n2 are 12 and 30 respectively ?
Declare integer variables n1,n2,i,j and flag
Read the values of n1 and n2
for i=n1+1 to n2-1
set flag=1
for j=2 to i/2
if i mod j=0 then set flag=0
break
end if
end for
Question 6
If flag=1 then print I
End if
Set i=i+1
End for
A: will print all values from 12 to 30
stop
B: 12 15 18 21
C: 13 15 17 19 21 23 25 27 29
D: 13 17 19 23 29
Question 7
What will be the output of the following pseudocode ?
intger a,b,c
Set a=10,b=20
For(c=a;c<=b;c=c+2)
a=a+c A: 20 23
b=b-a+c B: 20
if(a>10) C: 22
print a D:20 32
else
print b
Question 8
Integer a,b,c,a1,b1,c1,a2,b2,c2
Set a1=2,b1=45 and c1=36
set a2=11,b2=26,c2=30
A: 13 12 66
c=c1+c2
B: 14 12 6
b=c/60
C: 13 71 66
c=c mod 60
D: 14 12 1
b=b+b1+b2
a=b/60
b=b mod 60
a=a+a1+a2
Print a b c
Question 9
Integer a,b
set a=2,b=50
while (b>0)
a=b mod 2+a
if( a mod 3 IS EQUAL TO 0)
print a
A: 50 10 2
else
B: 49 3 1
print b-1
C: 50 3 2
b=b/5
D: 3 3 3
a=a+1
Question 10
what will be the output of the following pseudocode?
Intger i,j,sum,n
set sum =0,n=7
repeat for i =1 to n
A: 204
sum=sum+(i*i)
B: 64
end loop
C: 8
print sum
D: 140
Question 11
end for
for(c=0;c<=5;c++)
print array[c]
end for A: 67 45 23 13
B: 67 45 23 13 12
C: 45 67
D: 12 13 23 25 45 67
Question 13
what will be the output of the following the pseudo code for the input
n=6745?
read n
assign the given integer to a new variable q=n and set rn=0
r=q mod 10
rn=rn*10+r
A: 5476
q=q/10
B: 7645
repeat steps 4 to 6 while q>0
C: 3423
print rn
D: 457
Question 15
what will be the output of the following the pseudo code?
int a=10,b=4,I
if(a>b)
if(a+b>14)
print a
else
A: 4
for(i=1 to 3)
B: 14
a=a+i
C: 16
end for
D: 10
print a
else print b
Question 16
what will be the output of the following the pseudo code for input 4
int sum(int num)
if num is not equal to 0
return num + num*sum(num-1)
else print num
A: 26
B: 15
C: 44
D: 64
Question 17
what will be the output of the following the pseudo code for the input
x=22 and y=3?
declare x,y,m,n
set m=x and n=y
while m not equal to n then
if m greater than n
m=m-1
A: 4
else
B: 12
n=n-1
C: 3
end while
D: None of the mentioned
print n
Question 18
what will be the output of the following the pseudo code if we call fun1()
and the value of n is 5?
fun(int n, int a)
if(n==0) return a
A: 15
return fun(n-1,n*a)
B: 16
fun1(int n)
C: 120
return fun(n,1)
D: 24
Question 19
what will be the output of the following the pseudo code?
int a,b,c
set a=10,b=20
for(c=a;c<=b;c=c+2)
a=a+c A: 20 32
b=b-a+c B: 20
if(a>10) C: 22
print a D: 20 23
else
print b
Question 20
what will be the output of the following the pseudo code?
int a=6,b=9
intger n
set res=1
if(a>10 && b<a)
print error message
A: 21
else
B: 30
for(n=a;n<b;n=n+1)
C: error
res=res*n
D: 20
print res
Question 21
what will be the output of the following the pseudo code for a=3
void fun(int a)
if(a<1)
return
else A: 1 2
print a B: 3 1 1 3
fun(a-2) C: 2 1 1 2
print a D: 2 1 0
return
Question 22
what will be the output of the following the pseudo code?
int a=1,b=2
for (int i=0;i<=6;i=i+2)
a=a+b+I
a=a+b
b=a-b
print b A: 3 9 23 70
B: 3 7 10
C: 3 10 27 71
D: 3 10 27 70
Question 23
what will be the output of the following the pseudo code?
int a=2,b=3
int result=1
while(b!=0)
result =result*a
b=b-1
if(result>5) A: 8 1
a=a-1 B: 7 3
else C: 3 4
a=a+1 D: 6 1
print result,a
Question 24
what will be the output of the following the pseudo code?
int p=4,q=7,r=10
p= q mod r
q= q+p
r= r+q
print p,q,r
A: 7 11 17
B: 4 11 17
C: 7 14 24
D: 7 14 21
Question 25
what will be the output of the following the pseudo code?
input f=6,g=9 and set sum=0
integer n
if(g>f)
for(n=f;n<g;n=n+1)
sum=sum+n
end for loop A: 21
else B: 15
print error message C: 9
print sum D: 6
Question 26
what will be the output of the following the pseudo code?
1.int m=0,n=13,flag=0,I
2.m=n/2
3.for(i=2 to m)
4. if(n mod i=0)
5. flag=1 A: 1
6. goto line 9 B: 13
7.end if C: error
8.end for loop D: none
if flag=0 print n
else print 1
Question 27
what will be the output of the following the pseudo code?
int a,b
set a=125, b=122
if((a+b) MOD 2 EQUALS 0)
while(a>0)
b=a+b ; a=a/5
end while A: 234
print b B: 274
else C: 278
a=a-b; a=a/2 D: 2
print a
Question 28
what will be the output of the following the pseudo code?
int y,z,k,c; set y=8,z=3,k=1
if(z+k<y)
if(z mod 2 not equals 0)
c=y+z
else
c=y+k A: 8
y=y+z+k+c B: 20
else C: 21
y=y+c+k D: 23
print y
Question 29
what will be the output of the following the pseudo code for p=3, q=4
int fun1(int p,int q)
if(q equals 0)
return 0
if(q mod 2 equals 0)
return fun1(p+p,q/2)
return fun1(p+p,q/2)+p A: 12
B: 8
C: 7
D:None
Question 30
what will be the output of the following the pseudo code?
declare a, I,b
for i=0 to 4
increment a by 1
if i=3
print hello
get out of loop A: hello
end if B: 1
end for C: hello4
print a D: 4
Question 31
what will be the output of the following the pseudo code?
int i , N=5
int sum=0
for i=1 to 5
sum= sum+(i*i)
print sum
A: 70
B: 65
C: 25
D: 55
Question 32
what will be the output of the following the pseudo code?
int a=3,b=13,c=14,d=7,I,j
if(a+c > b+d)
for(i=a to d)
c=c+i+b
i=i+1
print c A: 32
else B: 23
for (int j=b to c) C: 46
a=a+j+d D: 44
print a
Question 33
what will be the output of the following the pseudo code?
main()
{
int num[]={1,4,8,12,16}
int *a,*b;
int I;
a=num; A: 1,4,8
b=num+2; B: 2,4,8
i=*a++ C: 4,4,8
print(“%d,%d,%d”,i,*a,*b); D: 2,1,8
}
Question 34
what will be the output of the following the pseudo code?
int m=3 n=2, o=4
while(n>0)
m=m*o+n
n=n-1
end while
o=o+m A: 57 0 61
print m,n,o B: 3 2 4
C: 3 0 4
D: 61 0 57
Question 35
what will be the output of the following the C code?
#include<stdio.h>
void main()
{
int x=9,y=2,z=6;
int a=x & y | z;
printf(“%d”,a); A: 2
} B: 6
C: 0
D: None
Question 36
what will be the output of the following the pseudo code for Num=10?
declare i,j and Num
repeat for i=1 to Num
declare static sap and set sap=0
sap=sap+I
j=sap
end loop A: 65
print j B: 85
C: 75
D: 55
Question 37
what will be the output of the following the pseudo code ?
Integer a=1,b=2
for (int i=0;i<=6;i=i+2)
a=a+b+I A: 3 9 23 70
a=a+b B: 3 7 10
b=a-b C: 3 101 27 71
print b D: 3 10 27 70
end for
Question 38
what will be the output of the following the pseudo code for input 134?
int fun1(int num)
static int a=0
if(num>0)
a=a+1 A: 2
fun1(num/10) B: 8
else C: 3
return a D: 431
Question 39
what will be the output of the following the pseudo code ?
integer num,x,y,count=0
x=num<<1
y=x^num
y=y+1
while((y/2) NOT EQUALS 0)
if( y MOD 2 NOT EQULAS 0)
count=count+1
else
y=y/2
Question 39
if(count)
print “0”
print y
else
print “1”
print x
A: 0 85
B: 0 1
C: 1 171
D: 1 170
Question 40
what will be the output of the following the C code?
#include<stdio.h>
int main()
{
int y=5;
int z=y+(y=10)
print(“%d\n”,z); A: 4
} B: 20
C: 12 or 20
D: 12
Question 41
the following pseudo code is used for;
let LB be the lower bound and UB be upper bound of a linear array
initialize count kat lower bound LB
repeat for k=LB to UB
print a[k]
A: 4
B: 2
C: 16
D: 8
Question 51
what will be the output of the following the pseudo code?
Integer a,b
set a=10, b=7
for (int i=1;i<=5;i++)
A: 3 -3 -8 -12 -15
a=a+i+b
B: -6 -13 -19 -24 -28
while(a>6)
C: 3 -3 -8 -15
a=a+b
D: 3 2 1 0 -3
b=b-1
a=a-1
end while
print a
Question 52
what will be the output of the following the pseudo code ?
declare integer n,value,x1,x2
set value to 0, x1 to 0 and x2 to 1
set n to 5
repeat n times A: 10
print value B: 0 1 1 2 3
value = x1+x2 C: 0 1 2 3 5
x2=x1 D: 1 2 3 5 8
x1=value
end loop
Question 53
what will be the output of the following the pseudo code?
Integre a,b
a=2, b=50
while(b>0)
A: 50 10 2
a=b MOD 2+a
B: 50 3 2
if(a MOD 3 IS EQUAL TO 0)
C: 49 3 1
print a
D: 3 3 3
else
print b-1
b=b/5
a=a+1
Question 54
what will be the output of the following the pseudo code ?
integer i,f,num
set f=1, num=8
repeat for i=1 to num
A: 0
f=f*I
B: 8
end loop
C: 1
print f
D: 40320
Question 55
what will be the output of the following the pseudo code?
char str[10]=“India”, ch=‘n’
int ind[10], loop, j=0
for(loop =0;str[loop]!=‘\0’;loop=loop+1) A: 4
if(str[loop]==ch) B: 3
int[j++]=loop C: 1
for(loop=0;loop<j;loop++) D: 0
print int[loop]
Question 56
what will be the output of the following the pseudo code if we call fun1()
and the value of n is 5?
fun(int n, int a)
if(n==0) return a
return fun(n-1,n*a) A: 16
fun1(int n) B: 15
what will be the output the following pseudocode for a given array
a[5]=3,4,6,1,2 and pos is 2?
declare I,j,n,pos A: 3 4 2 1 2
set a[j]=a[j+1] C: 3 6 1 2
n=n-1 D: 3 4 1 2
what will be the output the following pseudocode for input a=9 and b=9
function(input a, input b)
if(a<b) A:65
return function(b,a) B: 72
elseif(b!=0) C: 56
return (a+function(a,b-1)) D: 88
else
return 0
Question 65
what will be the output the following pseudocode ?
input 5
Algorithm(int num) A: successful
set int i=2 B: un successful
while i<=num/2 C: it will not print anything
if num mod i=0 D: undefined behavior of algorithm
print “un successful” and exit
i=i+1
if(i==(num/2)+1)
print “successful”
Question 66
what will be the necessary condition to get desired element from a given
array by using the following algorithm?
if LOC=-1
Do_something(DATA, N, ITEM, LOC)
initialize counter set LOC=0, LOW=0,HI=N-1
repeat while LOW<=HI
MID=LOW+HI/2
if ITEM=DATA[MID]
LOC=MID
return LOC
if ITEM <DATA[MID]
Question 69
if ITEM <DATA[MID]
HI=MID-1
else
LOW=MID+1
A: File structure
B: Recursive data type
C: Storage structure
D: Abstract data type
Question 78
A: end nodes
B: Terminal nodes
C: Final nodes
D: Last nodes
Question 80
A: (n^3)
B: (n^2)
C: (n^3 log n)
D: (n^2 log n)
Question 81
A: bubble sort
B: heap sort
C: insertion sort
D: Quick sort
Question 82
which of the following data structure does not keep the track of address
of every element in the list?
A: String
B: Linear array
C: Queue
D: stack
Question 85
end if B: 1
if(c>b OR (a+c>b)) C: 2
D: 3
print b
end if
if((b+c) MOD a EQUALS 0)
print c
end if
Question 89
Integer n,t,d,c,r
set n=854323,d=3,c=0
set t=n A: 2
while(t>0) B: 2.5
r=t mod 10 C: 1
if(r EQUALS d) D: 8
c=c+1
end if
t=t/10
end while
print c
Question 90
pick out the correct statement to be filled in if to meet the queue
"is empty" condition.
bool isempty()
{ A: front>0 && front<rear
if(________) B: front<0||front>rear
return true; C: front<0 && front>rear
else D: front>0 || front<rear
return false;
}
Question 91
what will be the output of the following pseudo code
Integer array[]={0,2,4,6,7,5,3}
integer n, result=0
for(n:0 to 7)
A: 14
if n MOD 2 EQUALS 1
B: 13
result+=array[n]
C: 15
end if
D: 17
end for
print result
Question 92
what will be the output of the following pseudo code
Integer array[]={0,2,4,9,16,5,3}
integer n, result=0
for(n:0 to 7) A: 14
if n MOD 2 EQUALS 0 B: 25
result+=array[n] C: 23
end if D: 17
end for
print result
Question 93
what will be the output of the following pseudo code
Integer x,y,z
x=0
y=1 A: 1
x=y=z=0 B: 0
Print x C: error
D: 8
Question 94
what will be the output of the following pseudo code
Integer arr[5][5],I,j
for i:0 to 4
for j: 0 to 4
if I EQUALS 4 or I EQUALS 0
print arr[i][j]
end if A: print first and last row
end for B: print first and last column
End for C: print all boundaries of matrix
D: all elements of matrix
Question 95
what will be the output of the following pseudo code
Integern1,n2,n3,a
n1= a MOD 10; n2= a MOD 2; n3= a/100 Inputs:
If(n1+n2>n3) 1. a =987
print “Inside 1st if” 2. a=314
Else if(n1+n2+n3>n3+3) 3. a=247
print “Inside 2nd if”
Else if((n1_n2)/n3 equals 0)
print “Inside 3rd if”
Else
print “else”
Question 96
what will be the output of the following pseudo code
Integer arr[]={4,5,6,7}
Integer *p=(arr+1)
Print *p
A: 7
B: 6
C: 4
D: 5
Question 97
what will be the output of the following pseudo code for n=1
Void reverse (int n)
if (n greater then 5)
A: None of these
exit
B: it will print 1 infinite times
print n
C: 1 2 3 4 5
return reverse(n+1)
D: 1 2 4 6 8
Question 98
What do we call the binary tree with no successor?
A: Terminal Nodes
B: Last Nodes
C: Final Nodes
D: End Nodes
Question 99
what will be the output of the following pseudo code c=1
Integer fun(int c)
print c
if(c<3) A: 1 3 5 5
c=c+2 B: 1 3 3 3
fun( c) C: 1 3
end if D: None of the above
return c
End fun
Question 100
what will be the output of the following pseudo code
Integer p,q,r
Set p=2,q=7,r=-1
p=p+q+r-9
A: Good Bye
q=p+r-9
B: Take Care
If(p>q)
C: None
print “Good Bye”
D: Good bye Take Care
Else
print “Take Care”
Question 101
what will be the output of the following pseudo code
Integer i,sum
Set i=1,sum=0
sum=sum+i //Line 3
If(sum>500) A: 36
print I B: 45
Else C: 32
i=i+1 D: 28
goto line 3
End if
Question 102
what will be the output of the following pseudo code for n=5
Integer fun(Integer n)
if (n IS EQUALS TO 0)
return 0 A: 25
otherwise if(n is equal to 1) B: 40
return 1 C: 35
otherwise D: 45
return n*n+fun(n-2)
Question 103
If f(a,b) is called, what is returned?
Function g(int n)
{
if (n>0) return 1
else return -1 A: 1 if a>b,-1 if a<b, 0 otherwise
Integer array[]={10,20,30}
Print - 2[array] A: garbage value
B: -12
C: -30
D: -15
Question 105
Integer array[]={4,5,6,7}
Integer *p={arr+1} A: 12
Print *arr+ 9 B: 13
C: 90
D: 5
Question 106
what will be the output of the following pseudo code
Integer arr[5][5],I,j
for i:0 to 4
for j: 0 to 4
if i EQUALS 4 or i EQUALS 0 or j Equals 0 or j Equals 4
print arr[i][j]
end if
A: print first and last row
end for
B: print first and last column
End for
C: print all boundaries of matrix
D: all elements of matrix
Question 107
what will be the output of the following pseudo code
Integer a=5,b=10,c=15
Print(a+b)
Print(c<<3)
A: 10 20
B: 15 120
C: 15 30
D:some random numbers
Question 108
How many times A is printed
Integer I,j,k
For each i=0 to 4
for each j 0 to 2 A: 12
for each k 0 to j-1 B: 15
print A C: 18
end for D: 5
end for
End for
Question 109
A: Both P & Q
B: P only
C: Q only
D: Neither P nor Q
Question 119
Periodic collection of all the free memory spaces from contiguous block
Of the free space by an operating system is called
A: Garbage Collection
B: Concatenation
C: collision
D: Dynamic memory allocation
Question 120
Predict the output of the following pseudocode?
Integer a=2,b=50
a=a+b A: 52 48
b=a-b B: 2 52
Print a C: 52 2
D: 2 50
Print b
Question 121
What does the code do ?
Read n
for each k from 1 to n
r=k mod 10 A: print all the numbers divided by 7 from 1 to n
if r not equals to 0 B: none
print k C: To print all integers from 1 to n omitting those
values which are divided by 7
end if
D: prints all the multiples of 7
end for
stop
Question 122
What will be the output of the following code?
Integer a,b,v,c
Set a=7,b=12,v=70
While(v>5)
a=a-v
c=(a+b)mod 10
while(c>7)
b=b+c
end while A: 14 -2
v=v/2 B: 16 82
End while C: 12 1
D: 12 -1
Print b,c
Question 123
Print d
Question 124
When all the data that is to be sorted can be fitted at a time in the main
Memory, it is called
A: Radix sort
B: merge sort
C: External sort
D: Internal sort
Question 125
A: 2^(H+1)-1
B: 2^H +1
C: 2^H
D: 2^(H-1)-1
Question 127
A binary tree in which all the levels except possibly last, have the
maximum number of nodes and all the nodes at the last level appear as
Left as possible is known as ?
Ops: A. 3 B. 4 C. 5 D.6
Question 131
what will be the output of the following pseudocode?
1. input =5
2. algorithm
3. set integer i=2
4. while i<=num/2
5. if num mod i =0
6. print “unsuccessful” and exit;
7. i=i+1
8. if(i==(num/2)+1)
9. print”successful”
Ops: A. unsuccessful B. it will not print anything C. successful D.
undefined behaviour of the algorithm
Question 132
what will be the output of the following pseudocode?
1. intput f=6, g=9 and set sum= 0
2. integer n
3. if(g>f)
4. for (n=f;n<g;n=n+1)
5. sum=sum+n
6. end for loop
7. else
8. print error message
9. print sum
A. AC B. null ABC
C. ABCD D. AB
Question 134
what will be the output of the following pseudocode?
1. interger a=5, b=10, c=15
2. integer x=a+b
3. integer y=x<<1
4. integer z=y+c
5. print(z)
A. 10
B. garbage value
C. 45
D. 18
Question 135
Consider the given pseudocode and determine the output of the code?
1. declare an integer variable n,value, x1,x2
2. set value to 0
3. set x1 to 0 and x2 to 1
4. set value to 0
5. set x1 to 0 and x2 to 1
6. set n to 5
7. repeat n times
8. print value
9. value=x1+x2
10.x2=x1
11.x1=value
12.end loop
Ops A. 1 2 3 5 8 B. 0 1 2 3 4 5 C. 10 D. 0 1 1 2 3
Question 136
what will be the output of the following code? For a= 12 and b=-26?
1. start
2. take 2 variables a and b
3. check if a is less than 0 set a= -a
4. check if b is less than 0 set b= -b
5. repeat while a is not equal to b
6. if a>b set a=a-b
7. else set b=b-a
8. print a
9. stop
Ops: A. 2 B. 12 C. 4 D. 8
Question 137
what will be the output of the following pseudocode?
1. Character *ptr
2. Character Str[]=”abcdefg”
3. ptr=str
4. ptr+=5
5. print ptr
void fun(integer x)
integer y= 20
print(y)
return 0
A.17 B. 20 C. 30 D. 15
Question 140
what will be the output of following ?
1. Integer a[4]={3,2,6,9}
2. sum=0
3. for(i=0 to 4)
4. sum=sum+a[i]
5. i=i+1
6. end for
7. if(sum mod 2 equals 1)
8. print sum-1
9. otherwise
10.print sum
Ops: A. 11 B.19 C.21 D. 20
Question 141
A: 800 names
B: 750 names
C: 400 names
D: 850 names
Question 147
For which the following purposes, the given pseudocode can be used?
Read n
For k=1 to n
r=k mod 7
if r not equal to 0
print k
end
A: to print all integers from 1 to n deleting those integers which are
divisible by 7
B: to print the maximum number from 1 to n which is not divisible by 7
C: To print all the integer from 1 to n those are divisible by 7
D: None of the mentioned
Question 148
What will be the output of the following pseudocode?
Decalre x,y,i
Set x=2, y=4
For i=6 to x+1 A: 9 14 18 19
y=y+I B: 10 15 22 23
print y C: 12 17 21 22
i=i-1 D: 10 15 19 22
End for
Question 149
How many times “A” will be printed is the following pseudocode?
Integer a,b,c
For a=0 to 4
for b=0 to 2 A: 8
if a is greater then b B: 9
print A C: 7
end if D:10
end for
End for
Question 150
What will be the output of the following pseudocode for a=10, b=6
Integer func(Integer a, Integer b)
{
Integer temp
A: 4
while(b)
B: 3
temp=a MOD b
C: 1
a=b
D: 2
b=temp
end while
return a
}
Question 151
Which of the following formula will correctly calculate the memory
address of the third element of an array?
(w is the number of words per memory cell for the array)
A: n+1
B: n
C: 2n-1
D: n-1
Question 155
identify the point that is NOT true with respect to a Stack
A: Tree search
B: Binary Search
C: Hashing
D: Linear search
Question 157
suppose queue is implemented using a linked list and its front node and
rear nodes are tracked by reference variables will change during an
insertion into a NONEMPTY queue?
A: N/2(N-1)
B: 2N-1
C: 1/N
D: 2(N-1)/N
Question 159
maximum height of an AVL tree with 7 nodes is:
A: 3
B: 4
C: 5
D: 6
Question 160
information about which of the following options is not present in the
adjacency matrix representation of graph?
A: Edges
B: Nodes
C: Direction of edges
D: Parallel edges
Question 161
consider following functions and their complexities:
f1(n)=2^n
f2(n)=n^(3/2)
f3(n)=nlogn A: F3 < F2 < F4 <F1
f4(n)=n^logn B: F2 < F3 < F1 < F4
C: F3 < F2 < F1 < F4
D: None of the mentioned options
Question 162
consider a complete graph vertex set {01,2,3,4}. Entry Wij in the matrix
W below is the weight of the edge {I,j}.
what is the minimum possible weight of a spanning tree T in this graph
such that vertex 0 is a leaf node in the tree T??
A. 10
W
B. 8
C. 7
D. 9
Question 163
let G= (V,E) be a directed graph with n vertices. A path from “vi” to “vj”
in G
A. O(e^2)
B. O(n)
C. O(e+n)
D. O(e)
Question 165
in which of the following situations Queue implementations is useful?
A. load Balancing
B. When a resource is shared among multiple consumers
C. when data is transferred asynchronously between two processes
D. All the mentioned
Question 166
which of the following applications may use a stack?
A. 5
B. 4
C. 2
D. 3
Question 169
The order of an internal node in a B+ tree index is the maximum number
of children it can have. suppose that a child pointer takes 6 bytes. the
search field value takes 14 bytes, and the block size is 512 bytes. what is
the order of the internal node
A. 24
B. 26
C. 25
D. 27
Question 170
which of the following data structure may give overflow error, even
though the current number of elements in it is less than its size?
A. priority queue
B. circular queue
C. simple queue
D. none
Question 171
let the following circular queue can accommodate maximum six
elements with the following data
front =2 rear=4
queue =__________; L,M,N,_,_
what will happen after ADD O operation takes place?
A. None of the mentions options below
B. front =3 rear=4
queue=_______; L,M,N,O,___
C. front =3 rear=5
queue=L,M,N,O,___
D. front=2 rear=5
queue=_______: L, M,N,O,_____
Question 172
consider the list of 12 numbers:
44,33,11,55,77,90,40,60,99,22,88,66
if we try to sort the list using quick sort by taking 44 as pivot element,
then which of the following list will be obtained after the fourth
iteration?
A. 22,33,11,77,44,40,90,60,99,55,88,66
B. 22,33,11,55,77,90,40,60,99,44,88,66
C. 22,33,11,40,44,90,77,60,99,55,88,66
D. 22,33,55,11,77,90,40,60,99,44,88,66
Question 173
what is the prefix from of an infix expression p+q-r*t?
A. +pq-*rt
B. -+pq*rt
C. -+pqr*t
D. None of the above
Question 174
what will be the complexity, when two matrices of order p*q and q*r are
multiplied?
A. pq
B. pqr
C. pq^2r
D. pr
Question 175
which of the following is a type of sorting which relatively passes
through a list to exchange the first element with any element less than it
and then repeats with a new first element
A. bubble sort
B. heap sort
C. quick sort
D. selection sort
Question 176
consider an unsorted array A[1…n] with n distinct values, the following
algorithm can be used to search a given number x in that array
Assume that x is the present in the array A, what will be the expected
number of comparisons required by the algorithm before it terminates?
A. n-1
B. n
C. n/2
D. 2n
Question 177
how much time will be required to generate all the connected
components in tan undirected graph G with ‘n’ vertices and ‘e’ edges
when the graph is represented by an adjacency list
A. O(e^2)
B. O(n)
C. O(e+n)
D. O(e)
Question 178
Four matrices A1, A2,A3 and A4 of dimensions a x b, b x c, c x d and d x
e respectively can be multiplied in several ways with the different
number of total scalar multiplications
If a =10, b=100, c=20, d=5, and e=80, then at least how many scalar
multiplications are required here?
A. 80000
B. 14000
C. 44000
D. None of the mentioned options
Question 179
The number of values that can be held by an array arr(-1……n,1,n) is :
A. n
B. n(n+2)
C. n(n+1)
D. n^2
Question 180
if a binary tree has 10 nodes, then what is the height of the tree?
A. 3
B. 11
C. 9
D. 12
Question 181
The height of a tree is defined as the number of edges on the longest path in
the tree. The function shown in the pseudo-code below is invoked as height
(root) to compute the height of a binary tree rooted at the tree pointer root.
int height(treeptr n)
{ if(n == NULL) return -1;
if(n -> left == NULL)
if(n -> right == NULL) return 0;
else return B1; // Box 1
Question 182
A. inorder successor
B. inorder predecessor
C. preorder predecessor
D. none of the mentioned options
Question 184
consider the following graph:
which of the following sequence are Depth first traversals of the above
graph?
1. a b e g h f
2. a b f e h g
3. a b f h g e
4. a f g h b e
A. only 1 3 and 4
B. only 2 3 and 4
C. only 1 and 4
D. only 1 2 and 4
Question 185
consider the following operation along with enqueue and dequeue
operations on queries, where k is global parameter
multidequeue(Q)
{ what is worst case complexity of a
n=k sequence of m multidequeue()
operations on an initially empty
while(Q is not empty) and (n>0)
queue ?
{
A. (m)
Dequeue(Q)
B. (m^2)
n=n-1
C. (mk)
}
D. (m+k)
}
Question 186
maximum possible number of nodes in the Binary Tree at level 5 is:
A. 16
B. 31
C. 30
D. 28
Question 187
if L is the left node, M is the root node and R is the right node of node of
a binary tree, then an L-M-R traversal can be termed as:
A. Pre-order traversal
B. In-ordered traversal
C. Post-Order traversal
D. None of the mentioned
Question 188
suppose a binary search tree is generated by inserting in order of the
following integers.
50, 15, 62, 5, 20, 58, 91, 3, 8, 37, 60, 24
what would be the number of nodes in the left subtree and right subtree
of the root respectively
A. 8, 3
B. 7, 4
C. 4, 7
D. 3, 8
Question 189
the complexity of the selection sort algorithm in worst case is:
A. O(n^2)
B. O(n-1)
C. O(n)
D. O(n log n)
Question 190
which of the following is a direct search technique?
A. hashing
B. tree search
C. binary search
D. linear search
Question 191
consider a Binary tree having two pointers for each of its children.
These pointers are ser to NULL. if the corresponding child is empty. how
many NULL pointers does a binary tree with N nodes have?
A. n^(n-2)
B. n^(n+1)
C. n^2
D. n^n
Question 193
when we update an imperative data structure we typically accept that:
A. Array
B. Queue
C. Tree
D. Stack
Question 195
the working principle of the queue is
1. First-In-First-Out(FIFO)
2. Last-In-Last-Out(LIFO)
choose the correct answer from the options given below
A. only 2
B. Neither 1 nor 2
C. Both 1 and 2 depending on the situation
D. only 1
Question 196
To which of the following domain problems does the knapsack problem
belong?
A. Linear solution
B. NP complete
C. Sorting
D. Optimization
Question 197
An acyclic digraph, which has only one node with indegree 1 is called:
A. Disjoint tree
B. Direction oriented tree
C. undirected tree
D. direct tree
Question 198
what would be the minimum number of arithmetic operations required to
evaluate the polynomial p(x)=x^5 +4x^3+6x+5 for given value of x using
only one temporary variable?
end reverse() B. 1 2 3 4 5
C. 1 2 4 6 8
D. None
Question 203
what will be the output of the following pseudocode?
1. Intger I, sum
2. set i=1, sum=0
3. sum=sum+I
4. if(sum>500) A. 32
5. print I B. 28
6. else C. 45
7. i=i+1 D. 36
8. goto line 3
9. end
Question 204
what will be the output of the following pseudocode?
Integer n,d,a,b
set n=456,a=0,b=1 A. 15
while(n>0) 120
d=n mod 10 B. 654
a=a+d 120
b=b*d C. 12
n=n/10 24
end while D. None
print a
print b
Question 205
what will be the output of the following ?
Integer x,y,z
x=0
y=1
x=y=z=8 A. 1
print x B. 0
C. 8
D. None
Question 206
what will be the output of the following ?
Integer x,y,z,a
set y=2
A. 7
set x=(y=y*2)+(z=a=y)
B. 8
print x
C. 5
D. 9
Question 207
what will be the output of the following ?
1. Integer c,n
2. set n=6
3. set c=n
4. print c A. 2 4 6
5. c=c-2 B. 6 4 2 0
6. if(c>0) C. 6 4 2
7. goto line 4 D. 0 2 4 6
8. end if
Question 208
what will be the output of the following ?
Integer x,y,
for each x from 1 to 11
x=x+2
end for A. 12
print x B. 10
C. 11
D. 13
Question 209
what will be the output of the following ?
Integer n,j,k,c,t,b,array[5]
set n=7, c=1
set arra[5]={1,6,7,11,13}
b=array[0] A. 5
for each k from 1ro n-3 B. 4
b=b^array[k] //(^ bitwise XOR) C. 17
for each k from 2 to n-1 D. None
c=c^b
c=c^k
print c
Question 210
what will be the output of the following ?
Integeri,j,k,sum=0
for(i=0;i<5;i++)
for(j=0;j<3;j++)
sum=i+j A. 9
for(k=0;k<2;k++) B. 17
sum=sum+k C. 13
end for D. 7
end for
end for
print sum
Question 211
what will be the output of the following ?
Integera[], k, l ,m
set a[10]={24, 16, 22, 32, 18}
set l=0
A. 34
for(k from 1 to 6) and increment k by 2
B. 20
l=l+a[k+1]
C. 62
end for
D. 18
m=l/2
print m
Question 212
what will be the output of the following ?
integer p,q,r
set q=20 A. 6
for each p from 2 to 6 B. 8
q=q+p C. 10
end for D. 40
r=q/5
print q
Question 213
what will be the output of the following for a=1?
Integer fun(Integer a)
if(a<3)
a=a+2 A. 1
fun(fun(a)) B. 3
end if C. 5
return a D. 0
end fun()
Question 214
what will be the output of the following ?
Integer n,beg,end
set beg=5 end =7,sum=0
if(beg>end)
print sum+1 A. 7
else B. 9
for(n=end;n>=beg;n=n-1) C. 6
sum=sum+1 D. 3
n=n-1
print n
Question 215
data structure representation in memory is termed as:
A. file structure
B. recursive data type
C. storage structure
D. abstract data type
Question 216
what do we call the binary tree nodes with no successor?
A. End nodes
B. Last nodes
C. Terminal nodes
D. Final Nodes
Question 217
what is the time complexity of Bellman –Ford single source shortest
path algorithm
A. (n^2)
B. (n^3 log n)
C. (n^3)
D. (n^2 log n)
Question 218
what will be the output of the following pseudocode for n=99?
Integer fun(Integer n)
if(n>100)
return n-10 A. 91
return fun(fun(n+11)) B. 99
end fun() C. 110
D. 121
Question 219
what will be the output of the following pseudocode?
Integer value, n
set value =1, n=45
while(value less than equal to n)
value =value<<1 A. 32
end loop B. 60
print value C. 45
D. 64
Question 220
what will be the output of the following pseudocode if n=3 and elements
of the array are 12 24 64 72 88?
Integer fun(integer a[], integer n)
integer x
if(n IS EQUAL TO 1)
return a[3]
else
A. 24
x=fun(a,n-2)
B. 100
end if
C. 60
if(x<a[n]) return x
D. 88
else return a[n+1
Question 221
what will be the output of the following pseudocode?
Integer a,b,c
set a=10, b=3
c=a/b
b=a MOD c
print a b c
A. 10 1 3
B. 10 3 3
C. 0 0 0
D. 10 0 3
Question 222
which of the following operations is possible on array?
A. Insertion
B. Sorting
C. Searching
D. All of the mentioned
Question 223
for which of the following tasks, sorting is useful?
1.Report Generation
2.Minimizing the storage needed
3.Making searching easier and efficient
A. only 1
B. only 2 3
C. only 3
D. only 1 3
Question 224
which of the following is the simplest way of implementing a graph in C
or C++
A. m^m
B. m^3
C. log m
D. m
Question 226
If the only use of lazy lists in a given application is monolithic, then that
application:
C. 1
C. 1 2 3 2
1 1 34543
1 2 1 4 5 6 7 6 5 4
1 3 3 1
Question 230
what will be the output of the following pseudocode?
Integer n, f0, f1, f, I
Set n=5, f0=0, f1=3
for(each I from 1 to n)
A. 1 4 2 5 3
f=f0+1
B. 1 4 2 5 7
print f
C. 1 4 3 2 5
f0=f1
D. 1 4 3 7 3
f1=f
Question 231
what will be the output of the following pseudocode?
Integer x
set x=2
if(x IS EQUAL TO 1)
A. B
if(x IS EQUAL TO 0)
B. A
print “A”
C. C
else
D. B C
print “B”
else
print “C”
Question 232
what will be the output of the following pseudocode?
Integer a[5], b[5], c[5], k, l
set a[5]={5, 9, 7, 3, 1}
A. 7 13 13 11 11
set b[5]={2, 4, 6, 8, 10}
B. -3 -5 -1 5 9
for(each k from 0 to 4)
C. 3 5 1 -5 -9
c[k]=a[k]-b[k]
D. None of the mentioned options
for (each l from 0 to 4)
print c[l]
Question 233
what will be the output of the following pseudocode?
Integer x
set x=259
if(x EQUALS 0) A. 16
print “0” B. 7
otherwise
print x MOD 9
Question 234
what will be the output of the following pseudocode?
1. Integer c, n
2. set n=6
A. 2 4 6
3. set c=n
B. 0 2 4 6
4. print c
C. 6 4 2 0
5. c=c-2
D. 6 4 2
6. if(c>0)
7. goto line 4
8. end if
Question 235
what will be the output of the following pseudocode?
Integer x, y, z, a
set x=2, y=1, z=5
a=(x AND y) OR (increment z by 1)
print a
A. 3
B. 1
C. 5
D. 2
Question 236
what will be the output of the following pseudocode for x=4 and y=5?
Integer fun(int x, inty)
if(x>1)
fun(x-2,y+2)
A. 4 5 6
end if
B. 7 6 5
print y
C. 9 7 5
end fun()
D. None
THANK YOU