Question 1 |
Consider the string abbccddeee. Each letter in the string must be assigned a binary code satisfying the following properties:
For any two letters, the code assigned to one letter must not be a prefix of the code assigned to the other letter.
For any two letters of the same frequency, the letter which occurs earlier in the dictionary order is assigned a code whose length is at most the length of the code assigned to the other letter.
Among the set of all binary code assignments which satisfy the above two properties, what is the minimum length of the encoded string?
For any two letters, the code assigned to one letter must not be a prefix of the code assigned to the other letter.
For any two letters of the same frequency, the letter which occurs earlier in the dictionary order is assigned a code whose length is at most the length of the code assigned to the other letter.
Among the set of all binary code assignments which satisfy the above two properties, what is the minimum length of the encoded string?
21 | |
23 | |
25 | |
30 |
Question 1 Explanation:
Question 2 |
Define R_n to be the maximum amount earned by cutting a rod of length n meters into one or more pieces of integer length and selling them. For i > 0, let p[i] denote the selling price of a rod whose length is i meters. Consider the array of prices:
\text{p}[1]=1,\text{p}[2]=5,\text{p}[3]=8,\text{p}[4]=9,\text{p}[5]=10,\text{p}[6]=17,\text{p}[7]=18
which of the following statements is/are correct about R_7?
[MSQ]
\text{p}[1]=1,\text{p}[2]=5,\text{p}[3]=8,\text{p}[4]=9,\text{p}[5]=10,\text{p}[6]=17,\text{p}[7]=18
which of the following statements is/are correct about R_7?
[MSQ]
R_7=18 | |
R_7=19 | |
R_7 is achieved by three different solutions. | |
R_7 cannot be achieved by a solution consisting of three pieces. |
Question 2 Explanation:
Question 3 |
Huffman tree is constructed for the following data :{A,B,C,D,E} with frequency {0.17, 0.11, 0.24, 0.33 and 0.15} respectively. 100 00 01101 is decoded as
BACE | |
CADE | |
BAD | |
CADD |
Question 3 Explanation:
Question 4 |
Consider the weights and values of items listed below. Note that there is only one unit of each item.
The task is to pick a subset of these items such that their total weight is no more than 11 Kgs and their total value is maximized. Moreover, no item may be split. The total value of items picked by an optimal algorithm is denoted by V_{opt}. A greedy algorithm sorts the items by their value-to-weight ratios in descending order and packs them greedily, starting from the first item in the ordered list. The total value of items picked by the greedy algorithm is denoted by V_{greedy}.
The value of V_{opt}-V_{greedy} is ____________.

The task is to pick a subset of these items such that their total weight is no more than 11 Kgs and their total value is maximized. Moreover, no item may be split. The total value of items picked by an optimal algorithm is denoted by V_{opt}. A greedy algorithm sorts the items by their value-to-weight ratios in descending order and packs them greedily, starting from the first item in the ordered list. The total value of items picked by the greedy algorithm is denoted by V_{greedy}.
The value of V_{opt}-V_{greedy} is ____________.
36 | |
40 | |
16 | |
0 |
Question 4 Explanation:
Question 5 |
A message is made up entirely of characters from the set X= {P,Q,R,S,T}. The table of
probabilities for each of the characters is shown below:
If a message of 100 characters over X is encoded using Huffman coding, then the expected length of the encoded message in bits is_____

If a message of 100 characters over X is encoded using Huffman coding, then the expected length of the encoded message in bits is_____
225 | |
115 | |
275 | |
315 |
Question 5 Explanation:
Question 6 |
Consider the following table:
Match the algorithms to the design paradigms they are based on.

Match the algorithms to the design paradigms they are based on.
P-(ii), Q-(iii),R-(i) | |
P-(iii), Q-(i), R-(ii) | |
P-(ii), Q-(i), R-(iii) | |
P-(i), Q-(ii), R-(iii) |
Question 6 Explanation:
Question 7 |
Suppose P, Q, R, S, T are sorted sequences having lengths 20, 24, 30, 35, 50 respectively.
They are to be merged into a single sequence by merging together two sequences at a time.
The number of comparisons that will be needed in the worst case by the optimal algorithm for doing this is ____.
362 | |
358 | |
456 | |
320 |
Question 7 Explanation:
Question 8 |
Consider a job scheduling problem with 4 jobs J_1, J_2, J_3 and J_4 with corresponding deadlines: (d_1, d_2, d_3, d_4) = (4, 2, 4, 2). Which of the following is not a feasible schedule without violating any job schedule?
J_2, J_4, J_1, J_3 | |
J_4, J_1, J_2, J_3 | |
J_4, J_2, J_1, J_3 | |
J_4, J_2, J_3, J_1 |
Question 8 Explanation:
Question 9 |
Consider n jobs J_1, J_2 \dots J_n such that job J_i has execution time t_i and a non-negative integer weight w_i. The weighted mean completion time of the jobs is defined to be \frac{\sum_{i=1}^{n}w_iT_i}{\sum_{i=1}^{n}w_i}, where T_i is the completion time of job J_i. Assuming that there is only one processor available, in what order must the jobs be executed in order to minimize the weighted mean completion time of the jobs?
Non-decreasing order of t_i | |
Non-increasing order of w_i | |
Non-increasing order of w_it_i | |
Non-increasing order of w_i/t_i |
Question 9 Explanation:
Question 10 |
Suppose the letters a, b, c, d, e, f have probabilities 1/2, 1/4, 1/8, 1/16, 1/32, 1/32 respectively.
What is the average length of the Huffman code for the letters a,b,c,d,e,f?
What is the average length of the Huffman code for the letters a,b,c,d,e,f?
3 | |
2.1875 | |
2.25 | |
1.9375 |
Question 10 Explanation:
There are 10 questions to complete.
I have a request to the site owner that please don’t upload the options for Numerical Type Question[NAT], just make it as correct or wrong, if possible.
Pls avoid vulgar ads