Tagged articles
hash map
13 articles · Page 1 of 1
This article explains how LRU cache combines a hash map for O(1) key lookup with a doubly linked list to maintain access order, enabling O(1) get and put operations including eviction of least recently used items, illustrated with step-by-step examples and a complete Python implementation.
AlgorithmCache EvictionLRU cache
0 likes · 11 min read

This article first highlights Ctrip's employee benefits, then presents the LeetCode 560 subarray sum problem with detailed explanations and multi-language implementations using prefix sum and hash map, including Java, C++, Python, and TypeScript solutions, and discusses time and space complexities.
AlgorithmC++Java
0 likes · 6 min read

Learn how to design and implement an O(1) LRU (Least Recently Used) cache in Java using a combined hash map and doubly linked list, covering algorithm concepts, data structure choices, method details, and complete code with examples and explanations.
AlgorithmJavaLRU cache
0 likes · 10 min read

The article explains how Go 1.24’s new Swiss Tables hash‑map implementation replaces the traditional bucket‑based design with open addressing, SIMD‑accelerated probing, and metadata separation, detailing the underlying principles, performance advantages, handling of clustering and deletions, and a comparison with previous Go maps and Java’s HashMap.
GoSIMDhash map
0 likes · 16 min read

This guide outlines the core data structures—arrays, 2D arrays, queues, linked lists, stacks, trees, and hash maps—explaining their characteristics, typical use‑case scenarios, and concrete examples to help embedded developers write efficient, scalable code.
Queuearraysdata structures
0 likes · 6 min read

This article explains how to determine whether an integer array contains any duplicate values by iterating through the elements, using a hash map for constant‑time lookups, and provides a PHP implementation of the containsDuplicate function along with its time and space complexity analysis.
Algorithmarrayduplicate detection
0 likes · 4 min read

A whimsical yet technical dialogue among Go, C++, Python, Java, and C# representatives reveals the storage structures, collision‑resolution strategies, hash‑to‑index mapping techniques, and resizing policies used in their hash table implementations, highlighting trade‑offs and design choices.
capacitycollision-resolutiondata structure
0 likes · 9 min read

This article walks through a step‑by‑step interview scenario where a candidate solves the classic Two Sum problem, starting with a naïve nested‑loop approach, then improving it using a hash‑map to achieve linear time complexity, and discusses edge cases and code refinements.
JavaTwo Sumalgorithm interview
0 likes · 7 min read

This article explains how to solve the classic “longest substring without repeating characters” problem using a sliding‑window technique, detailing pointer management, duplicate detection, and a complete Go implementation.
AlgorithmGohash map
0 likes · 3 min read

This article explains cache fundamentals, common use cases, pitfalls of distributed caches, and presents a robust Go implementation featuring key‑value storage, LRU eviction, TTL handling, mutex‑protected concurrency, and practical API examples.
LRUTTLhash map
0 likes · 10 min read

After struggling with a seemingly easy scoring problem in a regional programming contest, the author details multiple Go implementations—including a map, a 27‑base array, and a trie—examines their time and memory issues, discovers input handling pitfalls, and ultimately achieves an accepted solution.
AlgorithmTriecompetitive programming
0 likes · 14 min read

The article explains perfect hash functions, their collision‑free construction methods such as FCH, CHD, and PTHash, compares them to conventional hash tables, reviews common and cryptographic hash functions, and shows how read‑only perfect‑hash maps deliver faster lookups and lower memory use for static key sets.
Algorithmbenchmarkdata structure
0 likes · 21 min read

A reverse‑engineer discovered that GTA Online’s slow startup stems from an inefficient if‑loop that scans a 10 MB JSON file 1.98 billion times, and by hooking strlen and replacing the loop with a hash‑map, reduced load times from six minutes to under two minutes.
GTA Onlinecode hookinggame loading
0 likes · 6 min read
