Professional Documents
Culture Documents
Week 11 finalSOL PDF
Week 11 finalSOL PDF
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
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
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)