data-structures

Data structure for a random world

So, I was thinking about making a simple random world generator. This generator would create a starting "cell" that would have between one and four random exits (in the cardinal directions, something like a maze). After deciding those exits, I would generate a new random "cell" at each of those exits, and repeat whenever a player would g...

Efficient data structure for searching numbers and strings

Hi, I have a scenario where in strings and numbers are combined into a single entity. I need to search based on the string or the number. How do I go about with the data structure for this? I thought of coming up with a hashing for strings and search tree approach for numbers. Can you please comment on my choice and also suggest better s...

When two trees are equal?

If in-order traversal of two binrary trees (not binary search trees) are the same, does it guarantee that the two trees are the same? if answer is no, then what about both in-order and pre-order traversal are the same? ...

circular array in queues

how mod is used to determine the front and end of the circular array in a queue? ...

What is faster and more convenient: Hashtable or Dictionary<int, double>()?

Preamble: I'm working at heavy-loaded applicaion that produces large data arrays. I wrote the following class using System; using System.Collections; using System.Collections.Generic; namespace CSharpSampleApplication.Data.CoreObjects { [Serializable] public class CalcItem { pub...

What is the best way to represent tree structure in memory as a cache?

Hello all I have tree with nodes. The nodes are constructed by TCP API request response value. To make less requests I'd like to represent the tree in a cache structure, that each time when TCP request are about to be invoked it will check the cache first. What is the best way to do it? I mean the tree cache part, in my case I'm using Qt...

Java data structures

Can someone tell me where can I get some tutorials or books or anything else on Data Structures using java cause I am having hard time understanding them, and I am not looking for the standard library so any help would be greatly appreciated. Thanks ...

Large text file dictionary of random words for benchmarking purposes?

I was wondering if anyone could point me to a very very large dictionary of random words that could be used to test some high performance string data structures? I'm finding some that are in the ~2MB range... however I'd like some larger if possible. I'm guessing there has to be some large standard string dataset somewhere that could b...

implementing a dictionary

Hii , I ran across a interview question of implementing a dictionary that can implement the features of auto-completion , auto - correction , spell check etc... I actually wanted to know which data structure is the best for implementing a dictionary and how one approaches the above required features... Any links that guide me on this...

How to create binary tree using STL Set C++

Can anyone tell me how to implement Binary tree using C++ STL set. I have implemented binary tree using structures in C and class in C++ struct binary { int node; struct binary *left; struct binary *right; }; I am not sure about how to implement it using STL set. Actually I don't know how to to represent left and right in...

what is the main feature of stack?

what is the main feature of stack compare to arrays ...

Auto correction , auto complete features

Hii , We see suggestions when we type a word in Ms-word , google etc... How do they do that ? I would like to know how the techniqueslike auto correct , auto complete , spell checking etc.. are performed . HOw are the words actually stored... what algorithms are followed ... ??? Any links that suggest a possible way are welcome, ...

What data structure to use?

Hello, I need a data structure with the following properties: Access to elements must be very fast Elements, that are not added, shouldn't take memory (as ideal, size of empty structure near to zero) Each element has two integer coordinates (x,y) (access to elements only by them) Max count of elements known at creation time (over 10^3)...

which data structure is used in most popular databases?

i want to know which data structure(AVL, B-Tree, etc...) is used in most popular relational databases. and also in what way the data structure is superior than other in-class data structures? if possible a small comparison could help me a lot! thanks in advance! ...

C data structure library

I want to use a stack in C, anybody recommend a library? For example for a hash table I used UThash. Thanks! ...

implementing a TRIE data structure

Hii , i Was implementing a trie in C ... but i am getting an error in the insert_trie function . I could not figure out why the root node is not getting updated . Please help me with this. #include<stdio.h> #include<stdlib.h> #include<malloc.h> typedef struct { char value; int level; struct node *next; struct node *list; }n...

Creating a data structure to compare 300 elements with each other.

First of all, I'm looking at the interactions between around 300 elements. Each element will interact with all others and itself. In a minority of these cases, a reaction will occur, and I will mark that reaction. Since this is basically a matrix with around 90,000 possible interactions, I want to manage this data with code so I can e...

hash_map: why it defines less, rather than equal_to

C++, using Visual Studio 2010. A question about why a user-defined trait of hash_map actually requires total ordering. I have a simple structure, say FOO, which only has a number of integers. I'd like to use hash_map, which is a hash table whose keys are unordered, to store the structure of FOO. I just need a fast searching of its asso...

How to determine the actual memory usage of a data structure

In data structures, I know that the size of the structure depends on the internal links from one section to another. Is there a way, aside from JProfiler to tell exactly how much memory is tied up in a particular structure? For example, the class project this semester has to do with applying various structures to a song database. The ...

Parellel relationship data structure

i'm not sure of the term for this problem i'm having, or if it's even an issue to worry about at all. let's say i have a hypothetical situation like this: it seems as though having the link from remix objects back to the the original objects makes for a somewhat complicated structure, especially if i start to add more objects into the...