wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

KTR-CTECH-AN -18.04.2024

Total questions: 15

Worksheet time: 30mins

Name
Class
Date
1.
Which of the following algorithms is the best approach for solving Huffman codes?
a)
exhaustive search
b)
greedy algorithm
c)
brute force algorithm
d)
divide and conquer algorithm
2.
How many printable characters does the ASCII character set consists of?
a)
120
b)
128
c)
100
d)
98
3.
Which bit is reserved as a parity bit in an ASCII set?
a)
first
b)
Seventh
c)
eighth
d)
tenth
4.
In Huffman coding, data in a tree always occur?
a)
Roots
b)
leaves
c)
left sub trees
d)
right sub trees
5.
The type of encoding where no character code is the prefix of another character code is called?
a)
optimal encoding
b)
prefix encoding
c)
frequency encoding
d)
trie encoding
6.
Which of the following is NOT a Catalan number?
a)
1
b)
5
c)
14
d)
43
7.
Which of the following numbers is the 6th Catalan number?
a)
14
b)
429
c)
132
d)
42
8.
Which of the following is not an application of Catalan Numbers?
a)
Counting the number of Dyck words
b)
Creation of head and tail for a given number of tosses
c)
Counting the number of ways in which a convex polygon can be cut into triangles by connecting vertices with straight lines
d)
Counting the number of expressions containing n pairs of parenthesis
9.
The recursive formula for Catalan number is given by Cn = ∑Ci*C(n-i). Consider the following dynamic programming implementation for Catalan numbers: #include<stdio.h> int cat_number(int n) { int i,j,arr[n],k; arr[0] = 1; for(i = 1; i < n; i++) { arr[i] = 0; for(j = 0,k = i - 1; j < i; j++,k--) ______________________; } return arr[n-1]; } int main() { int ans, n = 8; ans = cat_number(n); printf("%d\n",ans); return 0; } Which of the following lines completes the above code?
a)
arr[i] = arr[j] * arr[k];
b)
arr[j] += arr[i] * arr[k];
c)
arr[i] += arr[j] * arr[k].
d)
arr[j] = arr[i] * arr[k];
10.
If a, b, c, d are distinct prime numbers with an as smallest prime then a * b * c * d is a ___________
a)
Odd number
b)
Even number
c)
Prime Number
d)
all of the above
11.
If a, b are two distinct prime number than a highest common factor of a, b is ___________
a)
2
b)
0
c)
1
d)
ab
12.
If a, b are integers such that a > b then lcm(a, b) lies in _________
a)
a>lcm(a, b)>b
b)
a>b>lcm(a, b)
c)
lcm(a, b)>=a>b
d)
none of the mentioned
13.
The lcm of two prime numbers a and b is _________
a)
a/b
b)
ab
c)
a+b
d)
1
14.
Decimal 13 in base 8 can be represented as _________
a)
15
b)
12
c)
11
d)
24
15.
The linear combination of gcd(252, 198) = 18 is?
a)
252*4 – 198*5
b)
252*5 – 198*4
c)
252*5 – 198*2
d)
252*4 – 198*4