Disjoint Set Union (Union Find) - Case Studies

Download Q&A
Q. In a Disjoint Set Union, what does the 'Union by Rank' technique help to achieve?
  • A. Faster sorting of elements
  • B. Reduced height of trees
  • C. Increased memory usage
  • D. Faster searching in arrays
Q. In a Disjoint Set Union, what is the effect of union by rank?
  • A. It increases the size of the set
  • B. It keeps the tree flat by attaching smaller trees under larger trees
  • C. It merges sets randomly
  • D. It has no effect on the structure
Q. In a Disjoint Set Union, what is the role of the 'rank' of a set?
  • A. To determine the size of the set
  • B. To optimize the union operation
  • C. To track the number of elements
  • D. To store the parent node
Q. What is the initial state of each element in a Disjoint Set Union when it is first created?
  • A. Each element is its own set
  • B. All elements are in a single set
  • C. Elements are sorted
  • D. Elements are in random sets
Q. What is the time complexity of the 'Find' operation with path compression and union by rank?
  • A. O(n)
  • B. O(log n)
  • C. O(α(n))
  • D. O(1)
Q. What is the time complexity of the 'Find' operation with path compression in Disjoint Set Union?
  • A. O(1)
  • B. O(log n)
  • C. O(n)
  • D. O(α(n))
Q. What is the worst-case time complexity for a sequence of m union and find operations in Disjoint Set Union with path compression and union by rank?
  • A. O(m)
  • B. O(m log n)
  • C. O(m α(n))
  • D. O(n)
Q. Which of the following is NOT a common application of Disjoint Set Union?
  • A. Kruskal's algorithm for minimum spanning tree
  • B. Network connectivity
  • C. Dynamic connectivity queries
  • D. Binary search tree operations
Showing 1 to 8 of 8 (1 Pages)
Soulshift Feedback ×

On a scale of 0–10, how likely are you to recommend The Soulshift Academy?

Not likely Very likely