prabhakar97 wrote:3. Consider the following relations in a Database where the relations indicate certain Customers purchasing clothes in certain shops.

C(CustName)

S(ShopName)

B(CustName, ShopName)

What does the following Relational Algebra equation return ?

Pi(CustName)(CxS-B)

a. Customers who have brought clothes from at least 1 Shop.

b. Customers who have not brought clothes from any Shop.

c. Customers who have brought clothes from all the Shops.

d. Customers who have brought clothes from only one Shop.

e. Customers who have brought clothes from more than Shop.

I marked A but probably I got this one wrong in a hurry. I believe it should be B

CxS gives cartesian product of C and S, and pi(CxS-B) will result in those cust names which DID NOT buy from all the shops, which is correct acc. to this question.

However, the question asked in the Exam was: C- pi custname(CxS -B) , therefore we get: Customers who bought clothes from all the shops. : 'c'

prabhakar97 wrote:8. The minute and hour hand of a clock meet at 12 noon and midnight. In between these two times they meet N times. N is:

a. 6

b. 11

c. 12

d. 13

e. None of the above

I marked E. The answer is 10

The answer is None of the above, alright... but isn't the reason because the answer is Actually "0"?

The hour hand moves 1 unit in the clock every 5 minutes, while the minute hand moves a unit of clock every minute. They Do Not overlap at anytime except for at 12noon and midnight.

prabhakar97 wrote:11. What will be the coefficient of x^3 in the polynomial [(1+x)^3][(2+x^2)^10]?

a. 2^14

b. (3C3) + (10C3)

c. (3C3)*(10C3)*2^10

d. 32

e. (3C3)*(2^9)

I marked E. Use binomial expansion, and its pretty easy.

(1+x)^3 = 3C0 x^0 + 3C1 x^1 + 3C2 x^2 + 3C3 x^3

(2+x^2)^10 = 10C0 x^0 *2^10 + 10C1 x^2 * 2^9 + 10C2 x^4 *2^8+ ......

multipying the above terms for coeffient of x^3 we get:

(3C1)*(10C1)*(2^9) + (3C3)*(10C0)*(2^10)

= 3*10*2^9 + 2^10

= 2^9*(30+2)

=2^9 * 32

= 2^9 * 2^5

= 2^14

so answer should be A

prabhakar97 wrote:13. An unsorted array of n elements is sorted by determining the Maximum value from the array, and eliminating it. This is followed by evaluating the maximum value from the rest of the array elements and eliminating it... and so on. What is the maximum number of comparisons that will be performed in the worst case:

a. linear order of n

b. O(nlogn)

c. O(n^2)

d. O(n^1.5) but not more

e. same as heap sort

I marked A

err... isnt the algorithm they are telling the same as Heap sort in a crude sense? ... in the Worst case... wont the number of comparisons be same as Heap Sort? thats what I think.... btw... what logic did you use?