Skip to content

集合 #7

@chris-paul

Description

@chris-paul

集合

集合是一种无序且唯一的数据结构,JS中集合的数据结构是Set

如果用数组实现集合,每次add都必须遍历数组性能很低,同时数组的key只能是字符串,所以实现集合最好的方式是Map,但是需要指出的是Map不是基础的数据结构,我们必须依赖于数组实现Map,再次基于map实现Set

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions