Hash lookup
Find two values with target sum
Use a map from value to index to find two values that add to a target in one pass.
Advanced Topics in Computer Science
Students learn fast lookup structures for uniqueness, counting, indexing, and key-value associations.
Unit Focus
The unit develops the ideas behind Java HashSet and HashMap while also showing how collisions and load factor affect performance.
Practice Work
Build a word-frequency analyzer with maps and sorting by count.
Implement a simple chained hash table and measure collision behavior.
DSA Assignment Bank
Code Scholars provides structured assignments, implementation support, edge-case review, and runtime analysis coaching so students learn the concept rather than only memorizing a solution.
Hash lookup
Use a map from value to index to find two values that add to a target in one pass.
Canonical keys
Create a key from sorted characters or counts so words with the same letters are grouped together.
Frequency map
Count characters, then scan in original order to find the first character that appears once.
Sliding window set
Determine whether the same value appears twice within k positions using a moving set.
HashSet boundaries
Use a set to start runs only at values that have no predecessor.
Prefix sum map
Track previous prefix sums so each new sum can count matching earlier sums.
Map plus heap or buckets
Count frequencies and choose an efficient structure to return the k most common values.
Map plus linked order
Design get and put operations that update recent-use order and remove the least recent item.
Substring set
Find repeated fixed-length strings by storing seen codes and duplicates separately.
Map equality
Decide whether two response lists have the same counts for every category.
Set and arithmetic
Given values from 1 to n with one missing and one repeated, identify both and explain tradeoffs.
Indexing strategy
Build a map from simplified word forms to possible dictionary words and discuss collision-like ambiguity.
Hash table internals
Write put, get, remove, and resize logic using buckets that store linked entries.
Performance experiment
Simulate inserts into a hash table and report how collision counts change as load factor grows.
Correctness risk
Explain how changing fields used in hashCode or equals after insertion can break map lookup.
Set intersection
Given several lists, return values that appear in every list while avoiding duplicate output.
Map from token to records
Given document titles and words, map each word to the set of documents where it appears.
Set operations
Given login and logout events, maintain the set of active users and report the peak active count.
Set uniqueness
Check whether rows, columns, and small regions contain no repeated nonzero values.
Map by transformed key
Given point coordinates, group pairs by slope or difference while avoiding double counting.
Map plus queue timestamps
Track recent request times per user and decide whether each new request is allowed.
Nested maps
Use a map from student to another map of assignment scores, then compute each student latest average.
Map from word to positions
Preprocess word positions so repeated distance queries can be answered efficiently.
Visited set
Given a map where each key points to another key, detect whether following links enters a cycle.
Map normalization
Replace words using a synonym map while preserving words not found in the map.
Sliding window map
For each window of size k, report how many distinct values appear.
Sliding window map
Use a map of last-seen positions to maintain a window with unique characters.
Indexing with maps
Create maps by student ID, course name, and grade level, then explain which query each map supports.
Hash quality
Given a hash function that maps many strings to the same bucket, describe the performance and propose a better approach.
DSA support
Create a staged assignment with frequency maps, indexing, collision analysis, and code review.
Work through the concepts, code, edge cases, and runtime analysis with 1:1 guidance.