HashMap does two important usecases
- translate original set to a different value set
- The value normally has certain designed pattern for comparison
- partition a large set into subgroup. each subgroup shared the same key/signature.
- The value/subgroup can be a set for storage, comparison, output
The HashMap translate usages are duplicates in a set/string/array, Palindrome, StringIsAnagram
The HashMap subgroup usages are below HashMap can also run multiple scans or bi-directional to handle complex logic
没有评论:
发表评论