Top "Dictionary" questions

A dictionary maps keys to values allowing efficient retrieval of values by keys.

hash function for string

I'm working on hash table in C language and I'm testing hash function for string. The first function I've tried …

c algorithm hash dictionary hashtable
Passing a dictionary to a function as keyword parameters

I'd like to call a function in python using a dictionary. Here is some code: d = dict(param='test') def …

python function dictionary parameters keyword
Loop through all nested dictionary values?

for k, v in d.iteritems(): if type(v) is dict: for t, c in v.iteritems(): print "{0} : {1}".format(t, …

python dictionary
sort dict by value python

Assume that I have a dict. data = {1:'b', 2:'a'} And I want to sort data by 'b' and 'a' so …

python dictionary python-2.6
Writing a dictionary to a text file?

I have a dictionary and am trying to write it to a file. exDict = {1:1, 2:2, 3:3} with open('file.txt', 'r') as …

python-3.x file dictionary file-writing
Remove an item from a dictionary when its key is unknown

What is the best way to remove an item from a dictionary by value, i.e. when the item's key …

python dictionary
Determining if Swift dictionary contains key and obtaining any of its values

I am currently using the following (clumsy) pieces of code for determining if a (non-empty) Swift dictionary contains a given …

swift dictionary
In Python, how do I iterate over a dictionary in sorted key order?

There's an existing function that ends in the following, where d is a dictionary: return d.iteritems() that returns an …

python sorting dictionary
Duplicate keys in .NET dictionaries?

Are there any dictionary classes in the .NET base class library which allow duplicate keys to be used? The only …

c# .net dictionary multimap
Dictionary text file

I am writing a program that needs A LOT of words of the English language. I am trying to find …

dictionary