Weighted brief explanations

I need help understanding the explanations posed by weighted quick connect questions:

Which of the following arrays id[]could be the result of launching a weighted algorithm for fast combining on multiple elements 10? Check all that apply.

Recall that our weighted quick join algorithm uses size aggregation (number of nodes) (rather than height aggregation).

False: 9 1 7 3 4 9 6 7 8 9
Explanation:9-5 7-2 5-0

False: 2 2 2 2 5 1 2 3 1 2
Explanation:2-9 3-7 9-3 5-4 0-2 1-8 8-4 4-9 8-6

Correct: 9 9 3 4 9 4 9 9 4 2
Explanation: the array id[]contains a loop:2->3->4->9->2

Correct: 0 2 3 0 0 2 2 9 3 0
Explanation: the size of the tree rooted in the parent is 2 <twice the size of the tree rooted in2

Correct: 0 4 6 7 4 1 5 1 7 3
Explanation: Forest height =4 > lg N = lg(10)

  • , ?
  • , , ?
  • ? (BTW , , )
  • ?
+4
2

, , .

, , ?

. . , . .

?

1. union , . ( SZ[]). (SZ[root(i)]).

?

. 1. 2 - A & B, A . max(A.height, B.height+1).

+3

, , ,

, node , node, , , , , .

0

All Articles