You are on page 1of 4

Week 11: Assignment

1. In disjoint set data structure, which of the following is true regarding Union(x,y)?
A) Replace Sx,Sy with Sx∩Sy and makes rep[SxUSy] =rep[Sy]
B) Replace Sx,Sy with SxUSy and makes rep[SxUSy] =rep[Sx]
C) It takes Θ(1) time
D) All of the above are true

2. What is the time complexity for Make-Set(x)?


A) Θ(log n)
B) Θ(n)
C) Θ(n log n)
D) Θ(1)

3. Which of the following is not true for a positive flow?


A) The flow of an individual edge must exceed capacity of that edge
B) The flow into and out of every vertex except source and sink must be equal
C) Flow value of an individual edge must not exceed capacity of that edge
D) The value of a flow is the net flow out of a source

4. In the figure below, find the value of f(v3,v1)+f(v3,v2)+f(v3,v4)+f(v3,t)


[Here f(x,y) means flow from x to y] (The values written on the edges are in the form
flow/capacity, if only one value is written, it indicates capacity)

A) 0
B) 2
C) 3
D) 1
5. Is the graph given below a valid network flow?( Assume that capacity of each edge is
equal to the flow given along each edge) If it is not valid , what is wrong? (The vertex
with plus sign is source and vertex with minus sign is sink)

A) Yes, it is valid
B) No, it is not valid as the flow out of V2 and into V2 are different
C) No, it is not valid as flow into V1 and flow out of V1 are not equal
D) No , it is not valid as flow into V3 and flow out of V3 are not equal

6. In disojoint set data structure, what does Find-Set(x) do?


A) Returns all values of set Sx which contains x
B) Returns sum of values of set Sx
C) Returns the representative of set Sx containing the element x
D) Returns a random value in set Sx

7. Which of the following does not hold(in general) in a flow network?


A) f (X,X)=0
B) f (X,Y)= -f (Y,X)
C) f (X,Y)= f (Y,X)
D) f (X U Y,Z)=f (X,Z)+f (Y,Z) if X ∩ Y= ∅

8. Given that the figure below is a valid flow network ,what is the value of flow for the
edges SV and UT ?(The capacity of every edge is 20) (vertex s is the source, t is the
sink).

A) SV=6,UT=5
B) SV=5,UT=7
C) SV=5,UT=5
D) SV=7,UT=7

9. In the flow network given below, what is the value of the flow(net flow out of source)?
,also find the value of x (consider the capacity of that edge to be 4)

A) Value of flow=18,x=2
B) Value of flow=19,x=0
C) Value of flow=19,x=3
D) Value of flow=18,x=0

10. Which of the following operation(operations) holds(hold) for Disjoint Set Data Structure?
A) Make-Set(x) ONLY
B) Union(x,y) ONLY
C) Find-Set(x) ONLY
D) Make-Set(x),Find-Set(x) and Union(x,y)

You might also like