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

Database Management System Homework Help

Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Database Management System Homework Help

Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 5

For any Homework related queries, call us at : - +1 678 648 4277

You can mail us at : - [email protected] or


reach us at : - https://www.databasehomeworkhelp.com/

Database Management System Homework Help


Q1. Why is not binary search suitable for a sorted linked list of
numbers?

a) Worst case time complexity of binary search on a linked list is


O(n).
b) Both halves of the list (to the left and the right of the middle
element) may have to be explored to search for an element.
c) The middle element in a sorted linked list cannot be found out in
O(1) time.
d) Size of a node in a linked list is more.

Answer: a), c)

Q2. Consider a max-heap of some numbers. Which of the following


is not true about a max-heap of numbers?
b) The second largest element is the number stored at the left or
right child of the root node of the max-heap.
b) The smallest element is found only at the leaf nodes of the max
heap.
c) The number of swap operations to initialize a max-heap is
O(nlogn).
d) The number of swap operations to find out the least number in a
max-heap is O(logn).

Answer: d) The number of swap operations to find out the least


number in a
max-heap is O(logn).

Q3. A single array A[n] (index range is from 0 to n-1) is used to


implement two stacks. The two stacks grow from opposite
ends of the array. Variables top1 and top2 (top1 < top2)
point to the topmost element in each stack. The space is to
be used efficiently. Which of the following statements is
wrong?

a) top1 is initialized to -1 and top2 in initialized to n.


b) Stack full condition for any stack is top1 = top2 - 1.
c) In each push operation in the second stack, top2 is
decremented by 1. d) Size of each stack must not be more than
n/2.

Answer: d) Size of each stack must not be more than n/2.

Q4. Numbers 1, 2, 3 are pushed into a stack in that order but


these three PUSH operations are intermixed with POP operations
as well. Whenever a number is popped, it is printed. Which of the
following permutation cannot be printed by such PUSH and POP
operations?
a) 1, 2, 3
b) 3, 1, 2
c) 2, 1, 3
d) 1, 3, 2

Answer: b) 3, 1, 2

Q5. Consider the set X={1, 2, 3, 4, 5) and R be a set such


that R= {(a,b): a²+b² <= 13}. What is n(R)?
a) 5
b) 8
c) 4
d) 10

Answer: b) 8

Q6. Let P={2, 3, 5}, Q=(3, 4, 7, 8), R={2, 1}. Find (PQ) x
(PNR).
a) {(2, 2), (3, 2), (5,2)}
b) {(4, 2), (7, 2), (8, 2)}
c) {(2, 2), (5, 2)}
d) {(2, 2), (3, 5), (5, 2), (4, 2), (7, 2), (8, 2)}

Answer: c) {(2, 2), (5, 2)}


Q7. Let U be the universal set. n(U)= 500. If A, B are
subsets of U such that n(A) = 100, n(B) = 200 and n(An B)
= 75, what is the value of n(¬AN¬B)?
a) 100
b) 225
c) 275
d) 0

Answer: c) 275

Q8. Let a relation R in the set R of real numbers be


defined as (p,q) ER if and if only if 1+pq> 0 for all p, q E R.
Which of the following is TRUE about the relation R?
a) reflexive only
b) reflexive and symmetric
c) transitive
d) Equivalence relation

Answer: b) reflexive and symmetric

Q9. Consider two sets X and Y. Which of the following


statement is false?
a) X-Y=Xn¬Y
b) X-Y=X-(XnY)
c) X-Y=X - Y
d) X - Y = (XUY) – Y

Answer: c) X - Y=X - Y

Q10. Let P = {1, 2, 3) and Q = {2, 3, 4). How many


relations are possible from P to Q?
a) 8
b) 64
c) 256
d) 512

Answer: d) 512

You might also like