The tag has no usage guidance.

learn more… | top users | synonyms

29
votes
4answers
28k views

Why store a function inside a python dictionary?

I'm a python beginner, and I just learned a technique involving dictionaries and functions. The syntax is easy and it seems like a trivial thing, but my python senses are tingling. Something tells me ...
7
votes
5answers
16k views

Efficient methods for storing tens of millions of objects for querying, with a high number of inserts per second?

This is basically a logging/counting application that is counting the number of packets and counting the type of packet, etc. on a p2p chat network. This equates to about 4-6 million packets in a 5 ...
7
votes
3answers
10k views

Practical size limits of a Hashtable and Dictionary in c#

What are the practical limits for the number of items a C# 4 Dictionary or Hashtable can contain and the total number of bytes these structures can reasonable contain. I'll be working with large ...
5
votes
2answers
408 views

What is a good way to keep track of strings for dictionary lookups?

I am working through the Windows 8 app tutorial. They have some code about saving app data like so: private void NameInput_TextChanged(object sender, TextChangedEventArgs e) { ...
5
votes
2answers
567 views

What are the relative advantages of dictionaries versus databases?

I have an environment that supports both dictionaries (json style) and databases (not relational or anything, just formatted data by row and column). My application doesn't really need database ...
4
votes
2answers
233 views

In Python, is there any difference (apart from a few listed exceptions) between classes and dictionaries?

My logic goes like this: def A(val): return {'a':val} print(A(7)['a']) is the same as class A: def __init__(self, val): self.a = val print(A(7).a) Obviously, there are problems ...
4
votes
2answers
2k views

Should I use a Class or Dictionary to Store Form Values

I am working on a C# .NET Application, where I have a Form with lots of controls. I need to perform computations depending on the values of the controls. Therefore, I need to pass the Form values to a ...
3
votes
2answers
6k views

Efficient solution for dictionary updates

Let's start with the problem: There is a large dictionary X that contains {key, value} pairs, i.e.: X = [{100, 10}, {101, 0}, {103, 0}, {106, 2}, {110, 1}] Every t seconds, X has to be updated ...
3
votes
2answers
612 views

History of Associative Array?

In quite a lot of modern scripting languages (e.g. Perl, Python, Ruby, PHP, Lua, JavaScript), associative arrays are supported as a primitive or first-class data type (with various names like map, ...
3
votes
3answers
2k views

Try to find a word in the dictionary that has most letters given

I recently came across an algorithm design problem that I'd like some help with: Given some letters, for example a,e,o,g,z,k,l,j,w,n and a dictionary of words. Find a word in the dictionary that ...
1
vote
1answer
685 views

Efficiency of C# dictionaries

C# dictionaries are a simple way to find if something exists etc etc. I have a question though on how they work. Let's say instead of a dictionary I use an ArrayList. Instead of using ContainsKey (or ...
0
votes
3answers
136 views

C# — Is there a key/key lookup table type provided in .NET?

It seems like a pretty straightforward thing to add, but I just want to be sure .NET doesn't already provide one and save me from adding unnecessary code: I need a lookup table (like a Dictionary) ...
0
votes
3answers
266 views

Class or Dictionary

I want to create a immutable Scale class in C#. public sealed class Scale { string _Name; string _Description; SomeOrderedCollection _ScaleValueDefinitions; Unit _Unit // ...
0
votes
1answer
254 views

What are the advantages of linear probing over separate chaining or vice-versa when implementing hash tables?

I've been brushing up on algorithms and reviewed these two methods of implementing hash tables. It seems like they largely have similar performance characteristics and memory requirements. I can ...
0
votes
1answer
945 views

Fast lookup hash map implementations

I'm in the process of implementing a programming language on top of LLVM. For my polymorphic system, I'm looking for suggestions for a ultra-fast dictionary. I am not concerned with insert time, as ...
0
votes
2answers
327 views

Critique the Structure of my Horse Racing Betting Platform

I am creating a program (mostly just for fun) that displays live prices for horse racing markets and the prices that several models predict they should be. I am very interested in the optimal way to ...
0
votes
1answer
137 views

Algorithm for compression of a dictionary (words and definitions)

The theoretical situation is this: Let's say that we have a digital dictionary (by which I mean a traditional list of words and definitions, not an associative array). For the sake of simplicity, ...
0
votes
0answers
20 views

What is the most efficient trie for comple multi-ligual data usage

Background Efficient Trie implementation for unicode strings I'm writing an app that will likely be run on systems that don't have much space or memory like my pi. Ideally my Trie would be efficient ...
-3
votes
2answers
84 views

Integer Map Algorithm [closed]

For my project, I need to map integers so that inputting int X will output int Y where both X and Y are defined during runtime. I've used Dictionary<int,int> in .NET but its memory use is too ...
-3
votes
1answer
155 views

Dictionary representation of an object

As python memory model is dictionaries of dictionaries, looks like any object in JavaScript has similar representation. Below code, > foo = {} makes foo as an empty dictionary {}. fine. If ...
-3
votes
1answer
91 views

Understanding searching through dicts in python [closed]

I'm trying to understand the differences between dict, dict.items and dict.iteritems. I know that items returns a list of all the items, while iteritems returns an iterator, which for large lists can ...