Files
Hui-s-notebook/Set.md
2023-09-10 10:50:53 +08:00

7 lines
275 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
不可重复,比较对象是否相等时要重写 hashCode 和 equals 方法
[[HashSet]] 基于 [[HashMap]] 的 key 实现,无序
[[TreeSet]] 基于红黑二叉树,自定义数据类型必须实现 Comparable 接口
[[LinkedHashSet]] 基于[[LinkedHashMap]]