data-structures

Lookup structure for handling future events (time based)

Hi, I am looking for an efficient data structure, that'll allow me to cue events ... that is, i will be having an app, where at any time in execution, it is possible, that an event will be raised for a future point in execution ... something like: t=20: in 420 seconds, A occurs t=25: in 13 seconds, B occurs t=27: in 735 seconds, C occ...

Memory mapped - partially disk based algorithms

Are there any good resources or books for spillable data structures, ie say a queue, when storing large objects it could fill up all of memory, but if you can keep say the most used items of that queue structure in memory and the rest on disk (sort of like paging), similarly this question applies to other structures such as linked lists,...

Python Implementation of the Object Pool Design Pattern

I need an Object Pool, and rather than implement it myself, I thought I would look around for a ready-made and tested Python library. What I found was plenty of other people looking, but not getting many straight answers, so I have brought it over here to Stack Overflow. In my case, I have a large number of threads (using the threading...

What are the best freely available university courses on Data Structures and Algorithms?

Hi, I am willing to learn in detail about Data Structures and Algorithms. What freely available university courses are there that cover data structures and algorithms? Thanks. ...

If Linked List and Array are fundamental data structures what type of data structure are tree, hash table, heap etc ?

Hi, I was going through data structure online class and it was mentioned that linked list and array are fundamental data-structures and so my question is about Hash table, Heap, tree and graph are those not fundamental data structures and if not are they derived from any other data structure ? Thanks. ...

What best book on data structures in java is recommended ?

Hi, I am looking for Best book on data-structures in Java, I know there are few good books on Data structures but they are from C++ perspective and am looking from Java perspective. Thanks. ...

What is the best datastructure to use in Java for a "multidimensional" list?

I need a dictionary-like data structure that stores information as follows: key [value 1] [value 2] ... I need to be able to look up a given value by supplying the key and the value I desire (the number of values is constant). A hash table is the first thing that came to my mind but I don't think it can be used for multiple values. ...

How should I index for a simple world of rectangles?

The world consists of many (1k-10k) rectangles of similar sizes, and I need to be able to quickly determine potential overlaps when trying to add a new rectangle. Rectangles will be added and removed dynamically. Are R-Trees appropriate here? If so, are there any good libraries I should consider? (I'm open to suggestions in any language)...

Visual Studio 2008 imports WSDL with wrong data type

Hi all, I'm trying to use a web service and thus added a web service reference to my project using the service's WSDL service description. All is well, there were no error message, but I noticed that one field is declared as string in my web service reference while it should be int. Going through the WSDL service description, I notice...

Reading data from JavaScript updated html

Is it possible to read the realtime updated quotes in this website through actionscript3, without having to reload the page all the time, which would be network-heavy. In other words, is it possible to stream the quote-data directly into actionscript3 or eventually PHP from javascript? If not does anyone have any suggestion to how to g...

Algorithms and Data Structures best suited for a spell checker, dictionary and a thesaurus

Best way to implement a dictionary (is their any DS better than Trie for Dictionary) thesaurus (no idea, as match is made on meanings of the words, similar meanings) spell checker (something better than a hash map), if possible with correct spelling recommendations. when asked in an 1-hr interviews, are we expected to write a...

What is the best way to use nested Objects with Subsonic when I only have Iqueryable for Foreign Key Relationships

I'd like to use Subsonic in a shopping cart application, but I'm trying to replace code that is using Session to store an Order object. That Order object has a collection or OrderDetail objects that are added to the collection through the shopping cart process. I'm impressed with what Subsonic can do and I think I'm missing how I could...

iPhone: Data structure choice

I need to keep track of a bunch of objects that can be identified by two keys (Latitude and longitude actually, but there are some other properties). I need to do things like search for a particular object by those two keys, updating it if it is there and inserting if not. I was thinking. I was looking at NSDictionary and NSSet but th...

Problem with Random and Threads in .NET

I'm having trouble with the Random class in .NET, I'm implementing a threaded collection which is working fine, except for one smaller detail. The collection is a Skip list and those of you familiar with it know that for every node inserted I need to generate a new height that is <= CurrentMaxHeight+1, here's the code that I'm using to d...

Java: What data structure to use to imitate PHP's associative arrays?

I want a data structure that allows me to map keys to values, like PHP's associative arrays. Each key can only exist once, but a value can be mapped to any number of keys. What am I looking for? Something in the Google Commons Collections? ...

Visual C++ equivalent of GCC's __attribute__ ((__packed__))

For some compilers, there is a packing specifier for structs, for example :: RealView ARM compiler has "__packed" Gnu C Compiler has "__attribute__ ((__packed__))" Visual C++ has no equivalent, it only has the "#pragma pack(1)" I need something that I can put into the struct definition. Any info/hack/suggestion ? TIA... ...

Practical uses of different data structures

There's a lot of talk about data structures, but I can't find a simple list of data structures and their practical use out there. I'm trying to study for an interview and I think this would help me out, along with many others. I'm looking for something like this: Data structure - Example/Used for Hash table - fast data lookup ...then...

Is this lock-free .NET queue thread safe?

My question is, is the class included below for a single-reader single-writer queue class thread-safe? This kind of queue is called lock-free, even if it will block if the queue is filled. The data structure was inspired by Marc Gravell's implementation of a blocking queue here at StackOverflow. The point of the structure is to allow a ...

Is there a way to maintain a 200MB immutable data structure in memory and access it from a script?

I have a list of 9 million IPs and, with a set of hash tables, I can make a constant-time function that returns if a particular IP is in that list. Can I do it in PHP? If so, how? ...

Java: Data structure for sorting objects/maintaining a key in that order?

I want to maintain a collection of objects of type Odp. Odp implements Comparable. I need to be able to refer to an object in the collection with its integer name. This integer must correspond to its sort order (not insertion order). Each integer only applies to one Odp, and vice versa. I have a function compareOdp(Odp o1, Odp o2) that ...