0% found this document useful (0 votes)
8 views

1.tee - Pla1001 - Set 1

Uploaded by

harknkn112
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

1.tee - Pla1001 - Set 1

Uploaded by

harknkn112
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Instructions:

I. Kindly mark the answers in the question paper itself. II. Put a tick mark over the correct option.
III. Write your registration number and name on all the pages.

Class Number: Reg. No.:

Name :

Invigilator Signature

TERM END EXAMINATION (TEE) – May 2023


B.Tech : Winter Inter 2
Programme : Semester
Sem 2022 - 23
Course Name : Programming for Computing Engineers Course Code : PLA1001
:
Faculty Name : Slot
Time : 1.5 hours Max. Marks :100
Q.No. Question Description Marks
What is the time complexity of the Simple sieve Algorithm?
1 2
a. O(nlogn) b. O(nlog(logn)) c. O(n^2) d. O(n^3)
What is the value of Euler’s phi of 245? 2
2
a. 168 b. 72 c. 120 d. 26
Find the 4th term value of x by applying the reminder theorem?
2
3 Input: x=5 mod 8, x = 6 mod 7, x= 4 mod 9

a. 1021 b. 521 c. 2029 d. 1525


Find the value 2nd term of x by applying the reminder theorem?
2
4 Input: x=4 mod 5, x = 4 mod 7, x=4 mod 5

a. 4 b. 319 c. 689 d. 39
Which of the following option is valid, when M=13, K=8, N=12, S=1, W=5, E=8; What 2
5 will be the return value in Alice apple tree?
a. 104 b. 55 c. 48 d. -1
What is the output after swapping two 4 bits if x=646? 2
6 a. 104 b. 136 c. 210 d. 254

What is the longest sequence of 1’s after flipping a bit of x=745? 2


7 a. 12 b. 5 c. 6 d. 10

Find the Longest sequence of 1’s after flipping a bit if n=Long.MAX_VALUE? 2


8 a. 32 b. 64 c. 128 d. 16
2
What are the not valid single digit strobogrammatic number?
9 a. 3,6,2 b. 4,7,5 c. 6,9,5 d. All of the above
In the Alice Apple Tree problem, what is the valid condition for Alice needs to pick to 2
10 get exact ‘k’ good red apples?
a. M<= K b. M<=S*K c. M>=S*M d. M==K
2
Which option is not a Valid Binary palindromic number?
11 a. 455 b. 903 c. 765 d. 895

1
Instructions:
I. Kindly mark the answers in the question paper itself. II. Put a tick mark over the correct option.
III. Write your registration number and name on all the pages.

2
Which option is a valid Binary Palindromic number?
12 a. 843,903,977 b. 951,765,689 c. 561,771,905 d. 403,633,771
What is the time complexity of the below program?
for(int i=2;i*i<n;i++){
if(condition is true) 2
13 for(int j=i*i;j<n;j=j+i){
statements;
}}
a. O(nlog(logn)) b. O(n) c. O(n*n) d. O(logn)
Which option is a valid number of Longest Sequence of 1’s after flip a bit when the 2
14 sequence is 5?
a. 453 b. 792 c. 885 d. 937
What is the output of the following code?
int a = 5, b = 7; 2
15 a ^= b ^= a ^= b;
System.out.println("a = " + a + ", b = " + b);
a. a = 7, b = 5 b. a = 0, b = 0 c. a = 5, b = 7 d. Compilation error
What is the Maximum sum of hour glass in the given matrix int [][]arr={{11, 12, 13, 13, 2
16 10},{8, 6, 10, 10, 20},{22, 13, 14, 20, 10},{3, 6, 10, 12, 8},{11, 12, 10, 12, 18}};
a. 96 b. 124 c. 86 d. 124
2
Predict the Majority elements in the given array if arr[]={2,3,2,2,3,3,2,3,2,3,2}
17 a. 2 b. 3 c. None of the above d. 2,3
Which option is a valid index of Maximum sum of Hour glass in the given array int []
[]mat={{11, 12, 13, 13, 10},{18, 16, 10, 10, 20},{22, 13, 14, 20, 10},{13, 16, 10, 12, 18}, 2
18 {11, 12, 10, 12, 18}};
a. [0,0 0,1 0,2 1,1 2,0 2,1 2,2] b. [1,0 1,1 1,2 2,2 3,0 3,1 3,2 3,3]
c. [1,2 1,3 1,4 2,3 3,2 3,3 3,4] d. [2,2 2,3 2,4 3,3 4,2 4,3 4,4]
What is the valid index of Maximum product of Subarrays if int arr[] = { 9,-7,5,-6,7,- 2
19 9,0,13160};
a. [1,2,3,4] b. [7] c. [0,1,2,3,4] d. [2,3,4,5.6.7]
What is the output if the given array arr[]={2,3,4,5,6,7,89,0} d=5 using Block Swap 2
Algorithm?
20 a. [ 0,89,7,6,5,4,3,2] b. [5,6,7,89,0,2,3,4] c. [6,7,89,0,2,3,4,5] d.
[7,89,0,2,3,4,5,6]
2
What is the output of Maximum sum of Equilibrium if int arr[] = {-2, 5, 3, 1, 2, 6, -4, 2 };?
21 a. 6 b. 7 c. 8 d. -2
2
What is the output of Maximum Sum of Equilibrium if int arr[] ={7,-6,3,5,7,2,1,-6}?
22 a. 10 b. 12 c. 9 d. 4
Given a string P consisting of small English letters and a string Q consisting of weight
of all characters of English alphabet such that for all ‘i’, 0 ≤ Q[i] ≤ 9. The task is to find 2
23 the total numbers of unique substring with sum of weights atmost K.
String P = "competitive exam"; String Q = "1234567891234567891234678"; int K = 6.
a. 6 b. 7 c. Invalid Input d. 12
How many Hamiltonian paths does the following graph have? 2
24 int arr[][]={{0,1,1,1},{1,0,1,1},{1,1,0,1},{1,1,1,0}}
a. 1 b. 2 c. 0 d. 3
What is the chromatic number in the given adjacent matrix?
int graph[ ] [ ]={{0,0,1,1,0,1,0,0,0,0,0}, {0,0,0,1,1,0,0,0,0,0,0},{1,0,0,0,0,1,0,0,0,0,0}, 2
{1,1,0,0,0,1,1,0,0,1,0}, {0,1,0,0,0,0,1,1,0,0,0}, 1,0,1,1,0,0,1,0,1,0,0},
25 {0,0,0,1,1,1,0,1,0,0,0}, 0,0,0,0,1,0,1,0,0,1,1}, {0,0,0,0,0,1,0,0,0,0,0},
{0,0,0,1,0,0,0,1,0,0,0}, {0,0,0,0,0,0,0,1,0,0,0}}.
a. 2 b. 4 c. 3 d. 5
26 What is the output when Rat starts the path from (0,0) in a Maze to reach the 2
destination (R-1,C-1) with the given array arr[][]={{1,1,1,1,1},{1,0,1,1,1},{0,1,1,1,0,0},

2
Instructions:
I. Kindly mark the answers in the question paper itself. II. Put a tick mark over the correct option.
III. Write your registration number and name on all the pages.

{1,0,1,1,1}} ?
a. (0,0 0,1 0,2 1,2 2,2 3,2 3,3 3,4) b. (0,0 0,1 0,2 0,3 1,2 2,2 2,3 3,3 3,4)
c. (0,0 1,0 2,0 3,0 3,1 3,2 3,2 3,4) d. No output
What is the output after moving all special symbols to the beginning of the String if 2
str=”Hel-@l%o !w]or.l/d;-$33# ”.
27 a. special symbol - 14 , characters- 10 b. special symbol- 12, characters- 12
c. special symbol- 13 , characters- 11 d. special symbol- 11, characters-13
2
What is the time complexity of Rat in a Maze?
28 a. O(2^NlogN) b. O(N^2) c. O(2^N^2) d. O(2^N!)
2
What is the time complexity of N-Queen problem?
29 a. O(1^N) b. O(1^N^2) c. O(N!) d. O(N^2)

Find the Max sum of Hour-glass in the array, r=5,c=4 if r-2,c-2 int arr[][]={{14, 22, 3, 2
30 20, 50},{11, 5, 34, 6, 7},{2, 1, 4, 43, 33},{12, 14, 42, 52, 21},{11, 41, 3, 17, 23}};
a. 205 b. 51 c. 157 d. 159
What is the lexicographically first palindromic string in the given string
2
str=”malayalam”?
31
a. Malayalam b. aalmymlaa c. alayala d. lamayamal
Find the Activities which are possible to complete in the given end time. If
2
start[ ]={2,5,3,7,4,8,6}, end[ ]={4,6,2,1,5,3,7}?
32
a. 0,1,2,4,5,6 b. 0,2,6 c. 0,1,2,3,4,5,6 d. 0,1,3,4,6
What is the chromatic number of the given adjacency matrix?
2
Int arr[][]={{0,1,1,0,0,0},{1,0,1,1,0,1},{1,1,0,1,1,1},{0,1,1,0,1,1},{0,0,1,1,0,0},
33 {0,1,1,1,0,0}}

a. 2 b. 3 c. 4 d. 5
Find the array rotation using block swap Algorithm if
arr[]={98,56,32,54,56,28,90,12,23}, d=10?
2
34 a. Invalid input b. {90,12,23,98,56,32,54,56,28}

c. {54,56,28,90,12,23,98,56,32} d. {56,28,90,12,23,98,56,32,54}
Which of the following option is valid, when M=18, K=3, N=20, S=4, W=5, E=3; if M!
2
=s*k , what will be the return value in Alice apple tree?
35
a. 18 b. 28 c. 30 d. 24
Who is the 4th leader in the given array if int arr[]={18,5,12,-20,16,10,4,8,7,8,1} ? 2
36
a. 18 b. 20 c. Invalid Input d. 16
Which option is the valid condition to check majority element in the given array if array
2
size n=6, k=number of occurrence ?
37
a. 2*n+1 >= k b. k<n c. k>n d. k>n/2
What is the value of (a+b)(c+d) if n=1 & b and d should be single digit & start from
2
(a+b)(c+d), 8765486 * 57823 using by Fastest multiplication method?
38
a. 12584 b. 8378480 c. 499605 d. 4080
What is the output if row=5, column=4 used to find the total number of ways? 2
39
a. 15 b. 35 c. 20 d. 16
2
40 How many total number of ways in the given input row=3 column=6 using

3
Instructions:
I. Kindly mark the answers in the question paper itself. II. Put a tick mark over the correct option.
III. Write your registration number and name on all the pages.

manuvering?

a. 18 b. 20 c. 21 d. 25
What is the compressed file size after applying fixed code if String s="aeoi iooeae
2
aoiai1o6aae", number of bits=3 ?
41
a. 120 b. 152 c. 200 d. 168
Which one of the following option is not a valid steps in fastest multiplication
Algorithm?
2
42 a. a*c b. ac*10^2N + ((a+b)(c+d)-ac-bd)*10^N+bd

c. b*d d. (a+b)*(c+d)
What is the value of Ac when Sc or N =2 input 4*9 in binary multiplication? 2
43
a. 420 b. 240 c. 16 d. 20
Given a string P consisting of lowercase characters and a string Q consisting of
weight of all characters of English alphabet such that for all ‘i’, 0 ≤ Q[i] ≤ 9. The task is
2
to find the total numbers of unique substring with sum of weights atmost K, if
44 P=”yrstibcxaerjft”; Q=”12395670912473496789099873”; int k=15.

a. 33 b. 32 c. 42 d. 21
Find the LPS in the given string using Manacher’s Algorithm? String
2
str="abcdefedghghgdefcdcba”.
45
a. 21 b. 11 c. 5 d. 3
Which is the valid condition of Euclidean algorthim using recursion approach?
2
46 a. euclid(a,a%b) b. euclid(a%b,b)

c. euclid(b%a,a) d. euclid(b%a,b)
Find the Longest sequence of 1’s after flipping a bit if n=797 ? 2
47
a. 4 b. 5 c. 6 d. 3
Which option is the valid position of Queens in the given N=8 matrix ?

a. (0,0),(1,4),(2,1),(3,5),(4,2),(5,6),(6,3),(7,7)
2
48 b. (0,1),(1,3),(2,5),(3,7),(4,2),(5,1),(6,6),(7,7)

c. (0,4),(1,1),(2,3),(3,6),(4,5),(5,6),(6,5),(7,1)

d. (0,5),(1,3),(2,6),(3,0),(4,7),(5,1),(6,4),(7,2)
Find the 3rd value of x if x=2mod7,x=2mod5,x=7mod9 ? 2
49
a. 42 b. 142 c. 772 d. 1087
What is the value of Ac when Sc or N =2 input 12*24 in binary multiplication? 2
50
a. 3712 b. 3904 c. 576 d. 256

You might also like