Redis Internal Data Structure Implementation
How Does a Key-Value Database Work?
Redis employs a hash table to store all key-value pairs. The primary advantage of a hash table is O(1) time complexity for quickly locating entries. Redis's hash buckets hold pointers (dictEntry *) to key-value data. The key-value data structure does not store values directly but uses void *key and void *valu ...
Posted on Sat, 06 Jun 2026 18:30:24 +0000 by cbolson
Hash Tables: Implementation, Collision Handling, and Hash Algorithms
Hash Table Implementation
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define TABLE_SIZE 20
typedef struct {
int key;
char* value;
} KeyValue;
typedef struct {
void* data;
int count;
} Collection;
typedef struct {
KeyValue* slots[TABLE_SIZE];
} SimpleHashMap;
SimpleHashMap* createMap() { ...
Posted on Fri, 05 Jun 2026 19:01:27 +0000 by bguzel
Inside Python’s Set Implementation: Mechanics and Operations
Core Mechanics and Hashing
Python's set type delivers an unordered collection of distinct objects. Its underlying architecture relies on a hash table, which enables near-constant time complexity for insertion, lookup, and deletion operations.
Hash Table Fundamentals
A hash table maps keys to array indices using a deterministic hashing algorithm ...
Posted on Mon, 01 Jun 2026 17:25:17 +0000 by Bopo
Data Structures and Algorithms: Mastering Hash Tables
Hash Table Fundamentals
A hash table is a data structure that allows for direct access based on a specific key. It is effectively an array designed for scenarios requiring rapid lookups to determine if an element exists within a collection. The key serves as the array index, enabling O(1) average time complexity for retrieval, as opposed to the ...
Posted on Fri, 22 May 2026 18:40:06 +0000 by anita999
HashMap Data Structure in Java: Fundamentals and Usage
HashMap vs Hashtable
Key Differences
Thread Safety: Hashtable is synchronized, while HashMap is not
Null Values: HashMap allows one null key and multiple null values; Hashtable prohibits null keys and values
Performance: HashMap generally performs better in single-threaded environments due to lack of synchronization overhead
HashMap ...
Posted on Thu, 14 May 2026 08:22:06 +0000 by harrylt
Data Structures 2018 - 951
Questions Multiple Choice Questions
The basic unit of data is ( ). A. Data Structure B. Data Element C. Data Item D. File In logical terms, data structures can be classified into ( ). A. Dynamic and Static Structures B. Compact and Non-compact Structures C. Internal and External Structures D. Linear and Non-linear Structures The condition for a ...
Posted on Sat, 09 May 2026 12:38:33 +0000 by nnpdn
Understanding Hash-Based Collections in Java: HashMap and HashSet Internals
Key-Value vs. Unique-Key Abstractions
Java’s Map and Set interfaces serve distinct roles in efficient data retrieval. Map implements a key-value association model—ideal for scenarios like counting word frequencies or mapping identifiers to attributes. In contrast, Set models uniqueness-only lookups—suitable for membership checks, such as verify ...
Posted on Sat, 09 May 2026 09:06:09 +0000 by sigmadog