hashtable Questions

3

Solved

Background It is quite common in PowerShell to build a hash table to quickly access objects by a specific property, e.g. to base an index on the LastName: $List = ConvertFrom-Csv @' Id, LastName, F...
Ronnieronny asked 27/6, 2022 at 12:45

10

Solved

It seems to be common knowledge that hash tables can achieve O(1), but that has never made sense to me. Can someone please explain it? Here are two situations that come to mind: A. The value is an...
Barncard asked 5/5, 2010 at 7:45

5

Solved

I want to map a function over the values in a hash table, like so: (hash-map add1 (hash "apple" 1 "pear" 2)) => #hash(("apple" . 2) ("pear" . 3)) Is there a library function to do this? It'd ...
Obligato asked 31/1, 2013 at 18:4

4

Solved

I have a data frame of two columns: key and value and I would like to create a dictionary using the respective row of each column for each element of the dictionary / hash table. As far as I under...
Henpeck asked 18/10, 2011 at 9:5

4

Solved

In CLRS excise 22.1-8 (I am self learning, not in any universities) Suppose that instead of a linked list, each array entry Adj[u] is a hash table containing the vertices v for which (u,v) ∈ E....
Mealtime asked 12/3, 2012 at 13:7

2

I've been doing some reading about hash tables, dictionaries, etc. All literature and videos that I have watched imply to hash-tables as having the space/time trade-off property. I am struggling ...

5

Solved

Section 6.6 of K&R discusses a hash table using a linked list. In short, a hash table is an array of pointers. The pointers point to a linked list. The linked list is a struct that looks like:...
Olio asked 10/8, 2011 at 17:0

8

Solved

Recently, I attended an interview and faced a good question regarding hash collisions. Question : Given a list of strings, print out the anagrams together. Example : i/p :    ...
Tradesfolk asked 13/9, 2013 at 7:55

2

Solved

I was watching Adrien Grand's talk on Lucene's index architecture and a point he makes is that Lucene uses sorted arrays to represent the dictionary part of its inverted indices. What's the reasoni...
Tola asked 21/7, 2017 at 4:16

3

I wonder if there is a less verbose way than using a loop. Anyway this works for me in CLISP: (loop for key being the hash-keys of *my-hash* collect key) I've seen others using maphash, but that...
Lareine asked 15/3, 2012 at 12:37

8

I am well aware of all the problems involved in comparing floats. This is exactly the reason for this question. I'm looking to create a fast hash table for values that are 3D vectors (3 floats - x,...
Ostrom asked 16/3, 2009 at 12:18

17

I'm looking for an explanation of how a hash table works - in plain English for a simpleton like me! For example, I know it takes the key, calculates the hash (I am looking for an explanation how...
Reversion asked 8/4, 2009 at 15:48

7

Solved

I've always used dictionaries. I write in Python.
Lazarus asked 13/1, 2010 at 23:53

8

Python dict is a very useful data-structure: d = {'a': 1, 'b': 2} d['a'] # get 1 Sometimes you'd also like to index by values. d[1] # get 'a' Which is the most efficient way to implement thi...
Reciprocate asked 23/7, 2010 at 13:38

1

Solved

In short: I have implemented a simple (multi-key) hash table with buckets (containing several elements) that exactly fit a cacheline. Inserting into a cacheline bucket is very simple, and the criti...
Carbonari asked 21/10, 2021 at 15:26

5

Solved

I have often heard people talking about hashing and hash maps and hash tables. I wanted to know what they are and where you can best use them for.
Junoesque asked 7/4, 2010 at 11:38

4

Solved

I'm looking for a possibly non-verbose portable way to initialize a hash table in Common Lisp. E.g. something that works for constant hash tables, but also to pre-load variable hashes. In CLISP I a...
Obscene asked 22/5, 2012 at 16:19

2

Solved

Lets say I have a hashtable: $HashTable = @{} Now, when I want to add something to the Hashtable I usually do it like this: $HashTable.Something = 'Something' When I test $hashTable it will show ...
Groundwork asked 25/8, 2021 at 10:8

9

Solved

I see how you can access your collection by key. However, the hash function itself has a lot of operations behind the scenes, doesn't it? Assuming you have a nice hash function which is very effic...
Broussard asked 20/5, 2016 at 13:50

2

Solved

I am playing around with hashtables in powershell and try to figure out, if there is a way, to show the content of Key1 (not the value). I tried several ways to have as an result "Monday" but eith...
Marienthal asked 21/8, 2019 at 15:0

4

Solved

If we look from Java perspective then we can say that hashmap lookup takes constant time. But what about internal implementation? It still would have to search through particular bucket (for which ...
Vacuity asked 18/3, 2013 at 4:31

2

I have a foreach loop that currently puts three entries in my hashtable: $result = foreach($key in $serverSpace.Keys){ if($serverSpace[$key] -lt 80){ [pscustomobject]@{ Server = $key Space = $s...
Planter asked 12/7, 2021 at 15:24

6

Solved

We are currently dealing with hash function in my class. Our instructor asked us to a hash function on the internet to compare to the two we have used in our code. The first one: int HashTable::h...
Breakfast asked 29/11, 2011 at 20:47

3

Solved

I am trying to let a user make a selection and then return a value from a hashtable based on that selection. My hashtable looks like this: $choices = @{ 0 = "SelectionA"; 1 = "SelectionB"; 99...
Raindrop asked 5/4, 2016 at 20:30

5

Solved

I was trying to count duplicate words over a list of 230 thousand words.I used python dictionary to do so. The code is given below: for words in word_list: if words in word_dict.keys(): wo...
Whitecollar asked 17/1, 2013 at 8:5

© 2022 - 2024 — McMap. All rights reserved.