Questions tagged [hashtable]

A hash table in programming is a collection that uses a hash function to map identifying values (keys) to their associated values.

hashtable
Filter by
Sorted by
Tagged with
2 votes
0 answers
56 views

How to use xmlHashScan function in libxml2 (c programming)

Can anyone tell me how to use the xmlHashScan function and the xmlHashScanner fucntion in the library libxml2 ? I have read the libxml2 doc for these two functions but it doesn't cotain enough ...
cheater's user avatar
  • 93
0 votes
0 answers
672 views

How to convert hashtable into XML?

In order to pass a varying number of parameters from a web application to a database stored procedure, I thought using an XML parameter would be a good solution. The problem is, the data in question ...
Matthew Walk's user avatar
  • 1,044
0 votes
1 answer
106 views

How to use jsHashtable to create a hashtable of JSON objects?

I understand how to use jshashtable to make a hashtable from scratch ie: <script type="text/javascript" src="jshashtable.js"></script> <script type="text/javascript"> var ...
irahn's user avatar
  • 13
0 votes
1 answer
3k views

VB.NET Get Keys by sorted Values in Hashtable

I am studying VB.NET and I want to know better idea to get Keys by sorted values in Hashtable Here is my solution that I built Dim int_Value As Integer() = New Integer() {-9, 2, 8, 6, 8, 1, -9} ...
NBB's user avatar
  • 137
1 vote
1 answer
313 views

How to create a Hashtable in javascript from a JSON by setting a value as the key?

I apologize if this is too vague, But I want to search each JSON object by a unique value and then spit out another value. I have been told it would be a good idea to create a Hash Table for this ...
irahn's user avatar
  • 13
1 vote
0 answers
379 views

Powershell: How To Parse Piped CSV Select-String Line Value into Values in Another Array

I am updating 288K SPO Doc Library Items with metadata from a CSV file. I am having trouble parsing the output of a Select-String object into values in my uploading Metadata array as shown here: # ...
Barry Prentiss's user avatar
1 vote
0 answers
1k views

Java: Linear Probing Remove method

i'm supposed to implement my own hash table through linear probing, however i'm having trouble with the remove function. it doesn't work correctly but i can't pinpoint the problem: public void remove(...
Meowzen's user avatar
  • 113
0 votes
1 answer
238 views

Huffman code length

I want to build a huffman tree and assign a code to all the 255 byte values based on their frequencies. But For my application I need a hash table to get the code for a byte in constant time. But in ...
Sayantan Ghosh's user avatar
1 vote
3 answers
2k views

check if Hashtable is full java

As stated in the topic, how can I check if Hashtable is full (if one could do that at all)? Having: HashMap<Integer, Person> p = new HashMap <>(); I imagine one needs to use e.g. if (...
Janna Sherazi's user avatar
0 votes
0 answers
41 views

How does bucket get implemented in hash table

I am new to Hash Tables and if I am not wrong, I understood that the we generate hash(value) and decide which bucket should the value be kept, but how are keys generated that are present in the ...
Manohar A's user avatar
0 votes
0 answers
68 views

Adding twice in hash table in C

Based on print statements in the rehashing section, I can see that the same string is getting added to the table multiple times. I believe the problem is in this function, although I can't see where. ...
Emily.SageMaker.AWS's user avatar
0 votes
1 answer
5k views

Hashtable with multiple values in GridView

I am storing data in a hashtable with multiple values like this: $hash = @{} $folders = dir (...) | where (...) foreach ($folder in $folders) { $num1 = (...) $num2 = (...) $hash.Add($...
user avatar
1 vote
1 answer
2k views

should I create a separate table for password and usernames?

hello am wondering if it's better to store the usernames and passwords in a separate table if I used hashing? also is there any link to read more about databases security I have read about hashing and ...
Mohammad Istanboli's user avatar
1 vote
1 answer
598 views

in SAS, is it possible to declare 2 hash tables in the same data step?

I'm able to declare 1 hash table like this: data DALY1; * set lengths ; length Germ $10 Category1 $50 Category2 $50 AgeGroupDALY $10 Gender $2 value 8; * make link to hash table ; if ...
stallingOne's user avatar
  • 3,871
0 votes
1 answer
983 views

In Golang, can I customise key comparison, if I am taking struct as key?

How does map in Golang compare keys? For some reason, I need to have a struct as a key, which has 2 values inside. I want map to compare by only first value, not second. Second is for my usage. Like ...
theGamblerRises's user avatar
5 votes
0 answers
575 views

Does unordered_map iterator/reference invalidation allow for cuckoo, hopscotch, and robin hood hashing?

I'm trying to figure out if it's possible to build a conformant, efficient implementation of modern C++'s std::unordered_map using techniques like Cuckoo Hashing, Hopscotch Hashing, and Robin Hood ...
Phil Miller's user avatar
  • 37.3k
0 votes
1 answer
221 views

Perl, Inserting a 2D hash into mySQL db

I have a 2D hash which I have to insert in a mySQL db .. Now the names of the columns in mysql table (report) are the same as 'vm_uuid' 'ip_addr' 'name' 'config_name' 'PrimaryKey' '...
Muzammil's user avatar
  • 638
1 vote
3 answers
622 views

Not an ARRAY reference when trying to trying to update old Perl code. Hash to Array issue?

I am trying to update an outdated perl plugin to Google's new API (They changed their search call). I'm new to Perl so I'm not sure how to correctly update the code. I'm pretty sure I'm trying to read ...
CREW's user avatar
  • 926
2 votes
1 answer
4k views

How to insert a key but no value into a std::unordered_map

I have a std::unordered_map< std::string, std::unordered_map<std::string, std::string> > and I want to just insert the key and fill up the values later. eg like this: #include <...
Angus Comber's user avatar
  • 9,494
0 votes
1 answer
831 views

What is a hash table that doesn't know the keys?

For example, if I create a dictionary in python I can use d.keys() to retrieve the keys. What is a hash table/dictionary without this kind of access? Storage might be an issue and the keys may be of ...
noɥʇʎԀʎzɐɹƆ's user avatar
1 vote
1 answer
542 views

How are HashTables in GLib Useful?

I'm familiar with the idea of a hash function but I'm unclear on how GLib's implementation is useful. I'll explain this with an example. Suppose I have an expensive function that is recursive (...
amcalde's user avatar
  • 203
82 votes
9 answers
34k views

Why is accessing an element of a dictionary by key O(1) even though the hash function may not be O(1)?

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 ...
monogate's user avatar
  • 1,419
0 votes
1 answer
26 views

I want change variable to value of hashtables in arraylist

I made [Hashtable hash] such as hash(i, 1) hash(j, 2) Also I made an [arraylist sArray] which include "i" or "j" such as sArray[0] : hello sArray[1] : first number is i ...
이정욱's user avatar
1 vote
1 answer
97 views

c# can't find object when use variable in hashtable

This is strange.. I am using a hashtable, and when I try to access an element with a variable, it does not find it. Here is my code: namespace gramerTest { class Program { private ...
Cong Wu's user avatar
  • 392
0 votes
1 answer
2k views

Hashing Elements by Mid-Square

I'm making a hash function for a hash table of size 10 (indexes 0-9), and hashing elements using mid-square method. The Problem is I'm confused whether i should use 1 middle digit or 2 digits then ...
Muzammil Aziz's user avatar
0 votes
1 answer
443 views

Replace value in specific column in CSV from hashtable

I have an imported CSV ($csv) with multiple headers, one of which is "Target Server". In the CSV this column has values device1, device2 etc. I also have a hashtable ($hash) with name/value pairs of ...
Archie's user avatar
  • 115
8 votes
3 answers
2k views

How can I improve spell check time in C program?

As one of the assignments in Harvard's CS50 course, students are tasked with creating a spell checking program. The main thrust of the assignment is speed - pure speed - and I've gotten to the point ...
Drew's user avatar
  • 89
-1 votes
1 answer
288 views

Hashtable get() operation not working as per documentation

According to the official documentation for the Java Hashtable class (https://docs.oracle.com/javase/7/docs/api/java/util/Hashtable.html), the get() opperation will return one of it's recorded values, ...
Cambot's user avatar
  • 257
0 votes
1 answer
121 views

What is the difference between Hashtable and HashMap if both throws ConcurrentModificationException in following code snippet?

In following code snippet, I tried with both Hashtable which is so called as thread safe and HashMap. But in both the cases I am getting ConcurrentModificationExceptionn. If this is so, then what is ...
pujan jain's user avatar
0 votes
3 answers
8k views

Use Powershell to Create Hash Table from .CSV File with Header

I have a .csv file (delimiter is |) that has AD fields as the header and the strings to go in there as the data. I'd like to create a hash table from that .csv file that has the column header as the ...
allenr74's user avatar
0 votes
1 answer
5k views

Why is this a bad hash function?

I'm currently covering hashing and hash tables and I'm wondering why something like the following is considered a bad hash function (pseudocode): function hash(String_t word, Int table_size) i = ...
JavascriptLoser's user avatar
1 vote
1 answer
3k views

adding a string into hash table

Trying to add an insert(self, key) method that inserts the key into the appropriate position while linear probing for resolving collisions. My current code, I'm just not 100% sure how to inset the str ...
M.Jones's user avatar
  • 459
-2 votes
1 answer
44 views

in which scenario we did insertion in Big-O(1) when array is full?

using hash-tables if array is completely filled than what is the best possible methode/scenario that we can do insertion in Big-O(1)... explain me in detail.
M Farooq Khalid's user avatar
0 votes
2 answers
130 views

adding is_empty to hashtable

I'm trying to add an is_empty(self) method. Which will return true if the hash table maps no keys to values, else false. This is what I have at the moment I'm just unsure how to approach the is_empty ...
M.Jones's user avatar
  • 459
1 vote
1 answer
2k views

Phonebook using hash table

I need help creating a small phone book application that uses hash table. This is for my school assignment. I'm very new to Java so I can't really get my head around this. I have a basic layout of ...
Gary Holmes's user avatar
3 votes
2 answers
276 views

Towards understanding dictionaries

I am required to use multiple hashtables, so in c++, I would normally use an std::unordered_map. So far I can understand that I can use a dictionary in Python, so let's assume the following code: ...
gsamaras's user avatar
  • 72.8k
1 vote
2 answers
158 views

How do i acess a nested hash map value that i have return from another class ? Java

I am new to hash mapping and I was trying to created a nested hash map on one side of the class and create another class to call it out, so here's how my code looks like public class Hash { ...
Annonymous177's user avatar
2 votes
1 answer
55 views

Perl Concatenating 2 hashes based on a certain key

Hi I have two hashes %Asset & %Activity %Asset Name,Computer Name David,X Clark,Y Sam,Z %Activity Name,Activity David,A Clark,B Sam,C David,D Clark,E Sam,F The second hash has the name repeated ...
Muzammil's user avatar
  • 638
20 votes
2 answers
32k views

How to check if an associative array is empty in powershell

$a = @() How do I check if $a above is empty (which it is). I would like to get $true as answer.
Spencer E's user avatar
  • 203
-1 votes
1 answer
221 views

Web Service state with HashMap

Good afternoon. Designing a web service that uses a login (and other actions) and keeps all user data and passwords in memory (does not use any database) I have been doubts when to ensure a decent ...
JLumos's user avatar
  • 117
0 votes
1 answer
76 views

How to use hashtable and bucket hashing

So recently I have been trying to practice with hashing and using linkedlists in a table to store values. I understand the concept but I am having trouble putting it into practice and can't seem to ...
MarkMAM's user avatar
  • 15
1 vote
1 answer
77 views

Hashtable or Binary Tree to search/insert/print/delete hashtags in a given text?

I have some doubts about, what is the best data structure for this task. I have multiple texts with #hashtags, and I want to detect and insert hashtags of that text in a good data structure. small ...
user3573685's user avatar
2 votes
1 answer
451 views

Solving 5SUM in O(n^3) with strict memory limits

I need a way to solve the classic 5SUM problem without hashing or with a memory efficient way of hashing. The problem asks you to find how many subsequences in a given array of length N have the sum ...
RazvanD's user avatar
  • 58
1 vote
1 answer
774 views

Hash tables - complexity of insert, search, and delete

I've been given two homework problems on the complexity of hash tables, but I'm struggling to understand the difference between them. They are as follows: Consider a hash function which is to take n ...
JavascriptLoser's user avatar
-1 votes
1 answer
3k views

How to fix Access Violation Reading location error? [closed]

I am currently working on a program that uses a Hash table. I have worked on my own Hash table class and the program works but then crashes after it has already done the work involving the hash table. ...
Caleb Sayers's user avatar
0 votes
1 answer
99 views

Passing Hash Table/Dictionary with a loop in JavaScript

However, I want pass an "ID" into the option "value" field with a corresponding string as the option text. So, if ID for Black = 1, White = 2, Blue = 3, then the html would look something like this: ...
mk8efz's user avatar
  • 1,394
3 votes
2 answers
164 views

How can i count comparisons are made when i try to enter a new key in a hash map?

I want to make a method to count how many comparisons are made when i want to put a new random key in my hash map . The code I used to put new keys in the map is the following : public void put(int ...
user avatar
-1 votes
1 answer
51 views

Hash Table ( Data Structure ) [closed]

Use the following data when building tables. 32, 64, 8, 23, 60, 47, 62, 59, 15, 29 Ans: 32-2 64-4 8-8 23-8 60-0 47-2 62-2 59-14 15-0 29-14 I understand the answers up to 23 ...
TheEWL's user avatar
  • 19
1 vote
1 answer
169 views

native memory is increasing while swap process

I have a function which works every hour in websphere server. Shortly, the function reads data from database and swap data with old one. Until a new call of this function, it stores data in memory ...
neverwinter's user avatar
1 vote
1 answer
61 views

SAS Looping/Lookup Through 2 Datasets

I have 2 datasets, one large and one small. While functionality is most important here, efficiency matters as well, because the large dataset could be potentially tens of millions of records. Let's ...
AidKulesh's user avatar
  • 109

1
46 47
48
49 50
110