Questions tagged [union-find]

A union/find data structure is a data structure used for maintaining a partition of a set.

184 questions
-2
votes
1 answer

Union Find - Quick Find

I just started the Princeton Algorithms course and tried to implement a very basic quick find algorithm in C as follows - #include void find(int *, int, int); void unite(int *, int, int); int main() { int arr[10], i, n1, n2, opt; …
-3
votes
1 answer

Union find: Quick find, how did the author arrive on these numbers (scaling)

In the coursera course, below union find is implemented for numbers only: https://www.coursera.org/learn/introduction-to-algorithms/lecture/EcF3P/quick-find public class QuickFindUF { private int[] id; public QuickFindUF(int N) { id = new…
Stacky
  • 503
  • 2
  • 6
  • 23
-4
votes
1 answer

union find operation in different cases

this is a paragraph from data structure book, by Narasimha Karumanchi (disjoint set ADT) fast find implementation(quick find) this method uses an array, where the array contains the set name for each element. In this representation to perform…
Raven
  • 11
  • 4
-5
votes
4 answers

How to solve manager peer problem question?

I was asked below question in google interview but could not answer it. I did google search but could not find any correct solution for this problem. Can you please help me to provide a solution for this problem? Design a data structure to support…
sachin
  • 97
  • 12
1 2 3
12
13