Guided Project: Hash Tables II

Learn how to solve common hash table problems including finding non-repeating characters and grouping elements by computed values.

Project Overview

Learning Goals

  • Understand frequency counting with hash tables
  • Apply hash tables to find non-repeating elements
  • Group elements by computed values
  • Optimize time and space complexity

Prerequisites

  • JavaScript Map and Set
  • Hash table concept understanding
  • Basic time complexity analysis
  • Array and string manipulation

Hash Table Use Cases

Common Patterns

  • Frequency counting
  • De-duplication
  • Grouping by properties
  • Two-sum pattern
  • Caching/memoization

Optimal Data Structures

  • Map: Key-value pairs with any type of key
  • Set: Collection of unique values
  • Object: Simple string-keyed lookups
  • WeakMap/WeakSet: When object references shouldn't prevent garbage collection