C++ 中的不相交集 ADT 实现
我在 C++ 中实现不相交集 ADT 时遇到问题,因为我们的老师只解释了并集和查找操作。我完全理解 union 和 find 的概念,但我仍然对如何实现它们感到困惑。
有人可以给我一个实现的想法,并解释一下这个数据结构的接口应该是什么样子吗?
I have problem in implementing a disjoint set ADT in C++ due to the fact that our teacher only explained the union and find operations. I fully understand the concepts of union and find but I am still confused about how to implement them.
Could someone please give me an idea of the implementation and also explain what the interface of this data structure should look like?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你的要求太多了,我们不是来帮你做作业的。
看看http://en.wikipedia.org/wiki/Disjoint-set_data_struct
You have way too many requirements, we're not here to do your homework for you.
Have a look at http://en.wikipedia.org/wiki/Disjoint-set_data_structure