手机扫码访问

导航
您当前的位置:首页 > 高教类 > 工学类
问题:

[单选题]

A lookup set is a data structure used to represent disjoint sets and supports the following operations:并查集是一种用于表示不相交集合的数据结构,支持以下操作:a1i答案窝(daanwo.com)-大学作业答案分享平台

A basic implementation is to organize the elements of each set into a rooted tree. The elements in the set are the nodes in the tree. The root of the collection is the representative element of the set. The entire search set consists of several trees. Composition of the forest. The interface implementation method is:一种基本的实现是将每一个集合中的元素组织成一棵有根树,集合中的元素即树中的节点,选取树根为该集合的代表元,而整个并查集就是由若干棵树组成的森林。接口实现的方法是:a1i答案窝(daanwo.com)-大学作业答案分享平台

Example: In the figure below, we look at the tree {c, h, b, e} and {f, d, g} that originally represented the two collections. After calling Union(h, f), we get the right tree. At this point, calling Find(e) returns f.例子:下图中的并查集原先有两棵表示集合的树{c,h,b,e}和{f,d,g},调用Union(h, f)后得到了右边的树,如果此时再调用Find(e)会返回f。a1i答案窝(daanwo.com)-大学作业答案分享平台

What is the best way to look for the most concentrated tree?并查集中的树最适合用什么方法表示:a1i答案窝(daanwo.com)-大学作业答案分享平台

AParent node method父节点法a1i答案窝(daanwo.com)-大学作业答案分享平台

BChild node method孩子节点法a1i答案窝(daanwo.com)-大学作业答案分享平台

CThe eldest son - Brothers Act长子-兄弟法a1i答案窝(daanwo.com)-大学作业答案分享平台

DAdjacent table method邻接表法a1i答案窝(daanwo.com)-大学作业答案分享平台

答案解析:

您可能感兴趣的问题
相关问题
关于我们 | 用户指南 | 版权声明 | 给我留言 | 联系我们 | 积分商城 | 答案求助 | 网站地图
Copyright © 2020 www.daanwo.com All Rights Reserved