mirror of
https://github.com/gopl-zh/gopl-zh.github.com.git
synced 2025-08-06 23:41:43 +00:00
修正半角标点符号
This commit is contained in:
@@ -107,7 +107,7 @@ func (*IntSet) Copy() *IntSet // return a copy of the set
|
||||
|
||||
**练习 6.2:** 定义一个变参方法(*IntSet).AddAll(...int),这个方法可以添加一组IntSet,比如s.AddAll(1,2,3)。
|
||||
|
||||
**练习 6.3:** (*IntSet).UnionWith会用`|`操作符计算两个集合的并集,我们再为IntSet实现另外的几个函数IntersectWith(交集:元素在A集合B集合均出现),DifferenceWith(差集:元素出现在A集合,未出现在B集合),SymmetricDifference(并差集:元素出现在A但没有出现在B,或者出现在B没有出现在A)。
|
||||
**练习 6.3:** (*IntSet).UnionWith会用`|`操作符计算两个集合的并集,我们再为IntSet实现另外的几个函数IntersectWith(交集:元素在A集合B集合均出现),DifferenceWith(差集:元素出现在A集合,未出现在B集合),SymmetricDifference(并差集:元素出现在A但没有出现在B,或者出现在B没有出现在A)。
|
||||
|
||||
***练习6.4: ** 实现一个Elems方法,返回集合中的所有元素,用于做一些range之类的遍历操作。
|
||||
|
||||
|
Reference in New Issue
Block a user