Questions tagged [hash-table]

A hash table is a data structure used to implement an associative array (a structure that can map keys to values). It uses a "hash function" to compute an index into an array from which the value can be found.

16 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
29
votes
0answers
888 views

Making a generic NSMapTable replacement written in Swift thread-safe

This is a follow-up to this question. While discussing some details about the code I posted there, I came upon a problem with thread-safety. After searching and trying different things, I reached a ...
6
votes
0answers
111 views

Bidirectional bijective hash map in C

I have this bidirectional hash map in C for dealing with bijective maps. Each key mapping consists of a primary key and a secondary key, and I can ask the data structure to give me a secondary key ...
5
votes
0answers
38 views

Variation of the internal PHP hashtable

I'm working on a PHP extension in an attempt to learn some C. I've implemented a variation of the internal PHP hashtable, which uses a lookup table and a separate bucket table. The lookup table simply ...
4
votes
1answer
100 views

Hashtable implementation in C for generic values

I am trying to implement a hashtable that supports character keys and can return any type of value contained in a struct as long as it contains as long as it contains ...
4
votes
0answers
68 views

General Purpose C Dictionary

I'm trying to create a general purpose C dictionary (as an opaque data type) capable of dynamically allocating basic types (ints, floats, strings and longs) as well as accepting void pointers to ...
3
votes
0answers
71 views

Implementation of a hash table using safe Rust

I just finished reading the rust book and I am doing lots of little projects to practice and try to get better at writing idiomatic Rust. One of them involves implementing a hash table (I find it's ...
3
votes
0answers
992 views

A map class based on an AVL tree

Here's an implementation of a class which is similar to std::map, but it's not a complete/identical implementation. I know C pretty well, but am a beginner with C++...
2
votes
0answers
52 views

Solution to 3Sum problem on Leetcode using HashTable

The problem of 3sum is described as: Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero....
2
votes
0answers
1k views

Map operation to update data | Hazelcast IMap returns clone object

I have a nested hazelcast distributed map: Map<CountryId, Map<CityCode, Map<data_key,data_value>>> where "data_key" is "population", "...
2
votes
0answers
116 views

Universal nested get/set for trees in Python

Based on this source, I've made the following universal get / set function, to make it possible to work on OrderedDict trees for example. ...
2
votes
0answers
1k views

Hash Table Implemented by Javascript

I recently tried to implement a simple hash table using Javascript. Could anyone help me review my implementation? ...
2
votes
1answer
1k views

Implementing a HashTable in Objective-C

I am trying to implement a hash table in Objective-C. I did some testing and the implementation seems to work. I am using an NSMutableArray to store linked lists ...
1
vote
0answers
473 views

Direct address hash table

Note: I do know that Python libraries provide better solutions. This implementation has been done to practice python, data structures and Algorithms. This is a implementation of Direct-address hash ...
1
vote
0answers
78 views

Fast HashIndex (HashTable) “template” for indexes and arrays C++

Another in the long line of data structures I'm writing for my 2D isometric game. This is a hashtable that only handles indexes, hence eHashIndex. It does not copy ...
1
vote
0answers
87 views

custom hash table<K,T> that take responsibility to assign hashcode/index

Introduction I try to create a game engine with component-based architecture. There are many type game components and different game systems. For example, the components can be Com_HP (health), ...
1
vote
0answers
107 views

Creating an updating hash table

I'm not sure if this implementation is good enough. The function takes a vector of 1 million chars and creates a table of the sequences that pass before the next occurrence of itself. Some questions ...