正在加载图片...
The Disjoint Set ADT The first is Find,which returns the name of the set (that is,the equivalence class)containing a given element. The second operation adds relations.If we want to add the relation a~b,then we first see if a and b are already related.This is done by performing Findson both a and b and checking whether they are in the same equivalence class. If they are not,then we apply Union.This operation merges the two equivalence classes containing a and b into a new equivalence class.The Disjoint Set ADT ◼ The first is Find, which returns the name of the set (that is, the equivalence class) containing a given element. ◼ The second operation adds relations. If we want to add the relation a~b, then ✓ we first see if a and b are already related. This is done by performing Finds on both a and b and checking whether they are in the same equivalence class. ✓ If they are not, then we apply Union. This operation merges the two equivalence classes containing a and b into a new equivalence class
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有