hashtable Questions

15

Solved

I have a structure in C#: public struct UserInfo { public string str1 { get; set; } public string str2 { get; set; } } The only rule is that UserInfo(str1="AA", str2="BB").Equals(Use...
Euripus asked 16/9, 2008 at 8:17

8

Solved

I'm using this (simplified) chunk of code to extract a set of tables from SQL Server with BCP. $OutputDirectory = 'c:\junk\' $ServerOption = "-SServerName" $TargetDatabase = "Content...
Shaylynn asked 26/1, 2012 at 7:45

2

Consider this code. I reserve 6 spots for an unordered_map and insert 6 elements. Afterwards, there are 7 buckets. Why is this? The max_load_factor is 1 and there are enough buckets for the number ...
Cassaba asked 29/1, 2021 at 6:55

5

Solved

What is the difference between HashTable and HashMap purely in context of data structures (and not in Java or any other language)? I have seen people using these terms interchangeably for the same...
Carmon asked 28/8, 2015 at 15:46

2

Solved

Problem When a Hashtable is used as input for Should, Pester outputs only the typename instead of the content: Describe 'test' { It 'test case' { $ht = @{ foo = 21; bar = 42 } $ht | Should -BeNu...
Teenateenage asked 6/1, 2021 at 19:38

18

Solved

What are the advantages of binary search trees over hash tables? Hash tables can look up any element in Theta(1) time and it is just as easy to add an element....but I'm not sure of the advantages...
Germicide asked 8/11, 2010 at 22:6

1

From Wikipedia link on Open Addressing : Open addressing, or closed hashing, is a method of collision resolution in hash tables. With this method a hash collision is resolved by probing, or se...
Headcheese asked 17/8, 2012 at 12:1

1

Solved

I want to associate to each person's name a list of numbers. keys = ["Fritz", "Franz", "Fred"] values = [[1, 2, 3], [4, 5], [6, 7, 8, 9]] If I run the following: impo...
Cain asked 6/10, 2020 at 10:36

1

Solved

I have tried this code: final ImmutableMap<String, String> map1 = ImmutableMap.of("username", userName, "email", email1, "A", "A1", "l", "500L"); final ImmutableMap<String, String> ...
Hagy asked 12/11, 2015 at 9:36

7

Solved

In cases where I have a key for each element and I don't know the index of the element into an array, hashtables perform better than arrays (O(1) vs O(n)). Why is that? I mean: I have a key, I ha...
Yttrium asked 18/8, 2012 at 18:3

3

Solved

Follow-up from this thread. Issue An ordered hashtable cannot be cloned. Question Is there an "easy" way to do this? I have indeed found some examples that seem overly complicated for such a "s...
Eighteenth asked 31/8, 2018 at 13:32

2

Solved

I'm a Python developer, making my first steps in JavaScript. I started using Map and Set. They seem to have the same API as dict and set in Python, so I assumed they're a hashtable and I can count ...
Dime asked 1/10, 2020 at 8:38

5

Solved

I've started to learn swift after Java. In Java I can use any object as a key for HashSet, cause it has default hashCode and equals based on object identifier. How to achieve the same behaviour in ...
Agadir asked 10/1, 2016 at 13:12

3

Solved

I was doing a program to compare the average and maximum accesses required for linear probing, quadratic probing and separate chaining in hash table. I had done the element insertion part for 3 ca...
Fanelli asked 25/8, 2012 at 10:35

5

Solved

I need to implement a structure in Java that is a key-value list (of types Integer-String) and I want to shuffle it. Basically, I would like to do something like that. public LinkedHashMap<In...
Hemipode asked 13/9, 2013 at 8:51

4

Solved

I'm using a dictionary to hold a large number of objects, and have a string name for each of them. To be specific, here is my code: from itertools import product for (i,j,k) in product(range(N),ra...
Guimond asked 8/5, 2014 at 3:55

2

I was wondering if there was a shorter way to create a multidimentional hashtable array in powershell. I have been able to successfully create them with a couple of lines like so. $arr = @{} $arr[...
Unwell asked 17/8, 2017 at 19:28

1

Solved

I am running the following PowerShell code, I need to keep the order of the original hash table keys. function New-GetServiceConnectionTask( $serviceConnectionId) { @{ environment = @{ } taskId...
Kaspar asked 14/5, 2020 at 18:21

2

I have a powershell Array object that is programmatically generated, something with arrays inside arrays, inside arrays, sometimes called a "property bag" or a "hashtable", but I think it's nativel...
Puberulent asked 12/12, 2016 at 18:49

3

Solved

When we are insert/lookup an key in a hash table, textbook said it is O(1) time. Yet, how is possible to have an O(1) lookup time? If the hash table store the key in a vector, it will cost O(N), if...
Hewett asked 17/1, 2013 at 5:54

3

Solved

So, I'm trying to create a tree-type variable that I could use for data navigation. I've ran into an issue while trying to use reference variables on hash tables in PowerShell. Consider the followi...
Digged asked 1/5, 2018 at 23:40

3

Solved

I'd like to store a hashtable in an environmental variable--is that possible in Powershell? Here's how I'm testing this: $env:test = @{} $env:test $env:test|gm And getting confused, because out...
Cadwell asked 29/10, 2012 at 19:26

1

Solved

I'm trying to understand and use the kernel hash tables and I've already read this and this link, but I didn't understand none of them. My first question is: Why our struct has to have the struct h...
Accomplice asked 26/3, 2020 at 15:34

1

Solved

Related to this question: Can I add a key named 'keys' to a hashtable without overriding the 'keys' member , I am actually often using the get_Keys() method as the recommended PSBase property will ...
Spun asked 23/3, 2020 at 9:1

1

Solved

It seems that I cannot add an arbitrary key name to a hashtable without overriding a member with that name if it already exists. I create a hash table ($x) and add two keys, one and two: $x = @{}...
Hymenopteran asked 22/3, 2020 at 18:36

© 2022 - 2024 — McMap. All rights reserved.