Algo 2 M3-M4

¡Supera tus tareas y exámenes ahora con Quizwiz!

Check all that apply. Consider a graph G=(V,E) with V ={a, b, c, d, e, f, g}. Consider the cut C = {{c,g},{a,b,d,e,f}}. Check all edges that cross the cut C.

(g,e)

Check all that apply. Consider a graph G=(V,E) with V ={a, b, c, d, e, f, g}. Consider the cut C = {{c,g},{a,b,d,e,f}}. Check all edges that cross the cut C.

(g,f) (c,f) (g,a)

Select the best answer for each dropdown menu. Complete the procedure SAME-COMPONENT(G).

(u,v) FIND(u) == FIND(v)

Check all that apply. This question is related to forest representation of disjoint sets. If x is the representative of the set S, then _____________________.

***PARTIAL*** If y ∈ S , then x could be the parent of y. x's parent is itself.

Select the best answer. This question is related to linked-list representation of disjoint sets. Consider two sets Sx and Sy that have 3 and 5 elements, respectively. A union (UNION(x,y)) of the sets Sx and Sy represented by x and y, respectively will perform _________________ update(s) of the attribute .head.

0

Select the best answer. This question is related to linked-list representation of disjoint sets. Consider two sets Sx and Sy that have 3 and 5 elements, respectively. A union (UNION(x,y)) of the sets Sx and Sy represented by x and y, respectively will perform _________________ update(s) of the attribute .member.

0

Select the best answer. This question is related to forest representation of disjoint sets. Consider two sets Sx and Sy that have 3 and 5 elements, respectively. A union (UNION(x,y)) of the sets Sx and Sy represented by x and y, respectively will perform _________________ update(s) of the attribute .parent.

1

Select the best answer. This question is related to forests representation of disjoint sets. Consider two sets Sx and Sy that have 3 and 5 elements, respectively. A union (UNION(x,y)) of the sets Sx and Sy represented by x and y, respectively will perform at most _________________ updates of the attribute .parent.

1

Select the best answer. This question is related to linked-list representation of disjoint sets. Consider two sets Sx and Sy that have 3 and 5 elements, respectively. A union (UNION(x,y)) of the sets Sx and Sy represented by x and y, respectively will perform _________________ update(s) of the attribute .next.

1

Select the best answer. This question is related to linked-list representation of disjoint sets. Consider two sets Sx and Sy that have 3 and 5 elements, respectively. A union (UNION(x,y)) of the sets Sx and Sy represented by x and y, respectively will perform _________________ update(s) of the attribute .tail.

1

Select the best answer. This question is related to linked-list representation of disjoint sets. Consider two sets Sx and Sy that have 3 and 5 elements, respectively. A union (UNION(x,y)) of the sets Sx and Sy represented by x and y, respectively will perform at least_________________ updates of the attribute .Object_set.

3

Select the best answer. This question is related to linked-list representation of disjoint sets. Consider two sets Sx and Sy that have 3 and 5 elements, respectively. Assuming using the weighted-union heuristic, the union (UNION(x,y)) of the sets Sx and Sy represented by x and y, respectively will perform _________________ update(s) of the attribute .Object_set.

3

Select the best answer. Consider a graph G=(V,E) with |V| = 6 and |E| = 9. Assume that DIJKSTRA(G,w,s) algorithm is executed on G with non null weights. Assume that the path p = < s, a, b, c, d> is a shortest path from s to d. The attribute v.d for these vertices v in p could reach δ(s,v) after ______ iteration(s) of the while loop .

4

Select the best answer. This question is related to linked-list representation of disjoint sets. Consider two sets Sx and Sy that have 3 and 5 elements, respectively. A union (UNION(x,y)) of the sets Sx and Sy represented by x and y, respectively will perform at most _________________ updates of the attribute .Object_set.

5

Select the best answer. This question is related to forest representation of disjoint sets. Consider two sets Sx and Sy that have 3 and 5 elements, respectively. A union (UNION(x,y)) of the sets Sx and Sy represented by x and y, respectively will perform _________________ update(s) of the attribute .parent.

??? 1

Check all that apply. Check all that apply about the set A in the generic algorithm that builds a minimum spanning tree for a graph G=(V,E).

A is a subset of E. |A|≤|V|−1

Check all that apply. Consider a graph G=(V,E) with V ={a, b, c, d, e, f, g}. Consider the cut C = {{c,g},{a,b,d,e,f}}. Check all sets A that the cut C respects.

A={(c,g), (a,b), (b,d), (d,e), (e,f)} A={(c,g), (a,b), (b,d), (b,f), (d,e), (e,f)}

Select the best answer for each dropdown menu. Complete the generic algorithm to build a minimum spanning tree.

Answer 1: A = {} Answer 2: A does not form a spanning tree Answer 3: safe Answer 4: A Answer 5: A = A U {(u,v)}

Select the best answer for each dropdown menu. Complete the procedure CONNECTED-COMPONENTS(G).

Answer 1: vertex v Answer 2: G.V Answer 3: MAKE-SET(v) Answer 4: edge (u,v) Answer 5: G.E Answer 6: FIND-SET(u) != FIND-SET(v) Answer 7: UNION(u,v)

Check all that apply. Consider a set V = {x1, x2, ...., xn}. Check all valid partitions.

Any union of elements from a partition P={MAKE-SET(xi)} (and removing elements involved in unions) P = {MAKE-SET(x1), MAKE-SET(x2), ..., MAKE-SET(xn-2), MAKE-SET(xn-1) U MAKE-SET(xn)} P = {MAKE-SET(x1), MAKE-SET(x2), ..., MAKE-SET(xn-1), MAKE-SET(xn)} P = {MAKE-SET(x1) U MAKE-SET(x2), ..., MAKE-SET(xn-1) U MAKE-SET(xn)}

Check all that apply. Consider a graph G=(V,E) with V ={a, b, c, d, e, f, g}. Consider the set A={(c,g), (d,b), (f,d), (b,f),(a,e)}. Check all cuts C that respect A.

C = {{a,c,e,g},{b,d,f}}

Check all that apply. Consider a graph G=(V,E) that may not be connected. These algorithms will somewhat create connected components of Graph G.

CONNECTED-COMPONENTS DEPTH-FIRST-SEARCH

Check all that apply. This question is related to forests representation of disjoint sets. Check all instructions/operations performed by MAKE-SET(x) using a forests representation.

Create a member set Ax. Ax.parent = Ax. Ax.member = x

True or False. This question is related to linked-list representation of disjoint sets. The same data structure can represent an object set and a member set.

False

Check all that apply. This question is related to forest representation of disjoint sets. If x is the representative of the set S, then _____________________.

If y∈S (x≠y), then x could be the parent of y. x's parent is itself.

Check all that apply. Check the primitive operations on disjoint sets.

MAKE-SET FIND-SET

Select the best answer. This question is related to forest representation of disjoint sets. Consider a set S such that |S|=m. Suppose that we just performed a FIND-SET(y) operation where y∈S. Assuming that path compression is used, the time complexity of a second FIND-SET(y), is _________________ .

O(1)

Select the best answer. This question is related to forests representation of disjoint sets of a set. The time complexity of MAKE-SET is ______.

O(1)

Select the best answer. This question is related to linked-list representation of disjoint sets. The time complexity of FIND-SET(x), where x represents a set of m elements, is _________________ .

O(1)

Select the best answer. This question is related to forest representation of disjoint sets. Consider a set S such that |S|=m. Suppose that we just performed a FIND-SET(y) operation where y∈S. Assuming that path compression is used, the time complexity of a FIND-SET(z) (z∈S and y≠z), is _________________ .

O(m)

Select the best answer. This question is related to forests representation of disjoint sets. Consider a set Sx such that |Sx| = m. Assuming using the union by rank heuristic, the time complexity to build the representation of Sx as a rooted tree is _________________ .

O(m)

Select the best answer. This question is related to linked-list representation of disjoint sets. Consider a set Sx such that |Sx| = m. Assuming using the weighted-union heuristic, the time complexity to build the representation of Sx as a linked-list is _________________ .

O(m)

Check all that apply. Let V = {a, b, c, d, e, f, g, h}. Check all valid partitions P.

P={ {g, h},{c, d, e, f}, {a, b}} P={ {g, h}, {a, b},{f, c, e, d}}

Check all that apply. Let V = {a, b, c, d, e, f, g, h}. Check all valid partitions P.

P={ {g, h},{c, d}, {e, f}, {a, b}} P={ V}

Check all that apply. Let V = {a, b, c, d, e, f, g, h}. Check all valid partitions P.

P={ {g, h},{c, d}, {e, f}, {a, b}} P={ V} https://www.youtube.com/watch?v=muiC-Gk9zFc

Check all that apply. A partition P of a set V is a set of nonempty subsets Si of V such that every element x in V is in exactly one of the subsets Si. This definition of P include the following properties: _________ (check all that apply).

The intersection of any two sets in P is empty. (∀Si,Sj∈P)Si≠Sj⟹Si∩Sj=∅ P does not contain the empty set ∅. (∅∉P) The union of all subsets Si in P is equal to V.

Matching. Consider a graph G=(V,E). Assume that DIJKSTRA(G,w,s) algorithm is executed. Assume that the path p = < s, a, b, c, d> is a shortest path from s to d and that no two edges have the same weight. The attribute v.d for these vertices v in p will certainly reach δ(s,v)in some order. Match the vertices s, a, b, c, and d to the their sequence number. The node that reach first δ(s,v) will be assigned 1. Note that we are ordering only s, a, b, c and d relatively to each other. This is not an ordering of all vertices v of V.

a = 2 b = 3 c = 4 d = 5 s = 1

Select the best answer. The correctness of the generic algorithm is proved by using ________.

a loop invariant technique

Select the best answer. This question is related to linked-list representation of disjoint sets. A linked-list of a set has _______________ member set(s).

any number of

Check all that apply. Consider a graph G=(V,E) with |V| = 6 and |E| = 9. We assume that all edges have nonnegative weights. Assume that DIJKSTRA(G,w,s) algorithm is executed. Assume that the path p = < s, t, x, y, z> is a shortest path from s to z. The table below shows on each column potential values of the attribute v.d. Check the columns that display values for v.d that could NOT be produced by DIJKSTRA's algorithm assuming that all edges have nonnegative weights. v.dC1C2C3C4C5 s.d 0 2 0 0 0 t.d 5 7 3 1 5 x.d 7 8 8 5 8 y.d 3 13 11 2 9 z.d 12 21 14 14 10

c1 c2 c4

Select the best answer. Consider the set A of edges that are part of a minimum spanning tree for a weighted graph G=(V,E,w). A safe edge is an edge that ______________.

if added to A, keeps A a part of some minimum spanning tree.

Check all that apply. Check all that apply to a minimum spanning tree MST of a graph G=(V,E).

it contains all vertices in V. It contains |V|-1 edges The MST contains a simple path between any pair of vertices in V

Check all that apply. This question is related to forests representation of disjoint sets. These are the attributes used for a member set.

member parent

Check all that apply. This question is related to forests representation of disjoint sets. These are the attributes used for an object set (root).

member parent

Select the best answer. This question is related to linked-list representation of disjoint sets. Consider two sets Sx and Sy that have nx and ny elements, respectively. Assuming using the weighted-union heuristic, the union (UNION(x,y)) of the sets Sx and Sy represented by x and y, respectively will perform _________________ update(s) of the attribute .Object_set.

min(nx,ny)

Check all that apply. This question is related to linked-list representation of disjoint sets. These are the attributes used for a member set.

next object set member

Select the best answer. This question is related to forests representation of disjoint sets. A forest tree of a set has _______________ object set(s) (root(s)).

one

Select the best answer. This question is related to linked-list representation of disjoint sets. A linked-list of a set has _______________ object set(s).

one

Check all that apply. Consider a graph G=(V,E) with V ={a, b, c, d, e, f, g}. Check all cuts as defined in the context of the generic minimum spanning tree algorithm.

{{a,c,e,g},{b,d,f}} {{b,f}, {a,c,d,e,g}}

Check all that apply. Consider a graph G=(V,E). Assume that there is a shortest path p = <V1, V2, ..., Vk>. Assume that DIJKSTRA(G,w,s) algorithm is executed. The attribute v.d for all vertices v in p will certainly reach δ(s,v) after N iterations of the while loop. The number N depends on _______.

|V|

Select the best answer. Consider a graph G=(V,E). Assume that all vertices in V are reachable from Vertex s within 5 edges. Assume that DIJKSTRA(G,w,s) algorithm is executed. The attribute v.d for all vertices v in V will certainly reach δ(s,v) after ______ iteration(s) of the while loop.

|V|-1


Conjuntos de estudio relacionados

MGMT Ch. 11- Building Customer Relationships Through Effective Marketing

View Set

LC11: LearningCurve - Ch. 11: The Labor Market

View Set

Chemistry Exam 1 Study Guide (No Math Questions) II

View Set

Anatomy and physiology test study questions

View Set

History of calculators and computers, input, output and memory.

View Set