# Recent questions tagged testseries

0 answers 8 views
0 answers 9 views
Is following grammar has language which is inherently ambiguous? $S \rightarrow aaAb | aab | A$ $A \rightarrow aaAb | aAb | \epsilon$ I think that this grammar has unambiguous grammar as follow. Let's first rewrite the grammar as below such that this grammar has same ... have to perform $S \rightarrow A$. Please help me with this. I want to know whether this language is inherenly ambigous or not?
0 answers 4 views
Consider th following cases for quick sort to sort an array of n element $a[0...n-1]$ i) Choosing the pivot element randomly from the given array ii) choosing median element as pivot. Iii) Choosing middle element as pivot For which of the above cases quick sort always gives $O(nlogn)$ time complexity?
2 answers 17 views
For the below message number of bits required in Huffman Coding is: abbaabccdabcd
0 answers 5 views
Here is my approach: Initial all block are empty - {100,500,200,450,600} When 212 request come then blocks size after allocation - {100,288,200,450,600} When 417 request come then - {100,288,200,33,600} When 112 request come then - {100,176,200,33,600 ... sufficient space so first fit fails here Thats my approach but in given solution first fits work well. Please tell the were i am doing wrong..
0 answers 11 views
Consider the following schema: Producer (pid, pname) Part (id, name, color) Category (pid, id) “Find the pids of producer who produces every black and white part”. Which of the following given options is a correct implementation of the above statement? Answer is given as But i think the given query is wrong. Please anyone suggest the correct answer.
0 answers 8 views
Consider the instance of a relation sailors is given below: Number of tuples return when the SQL query is executed on the given instance of the relation ________. Answer is given as 4. But i think the correct answer should be 8 beacuse untill and unless we will use distinct keyword the duplicacy is allowed in sql output.
What is the time complexity for finding maximum profit in Greedy fractional knapsack algorithm if number of items are N= $2^{n}$ ? O(n log n) O($n^{2}$log n) O($2^{n}$) O(n.$2^{n}$)