Questions regarding efficient storing and representing data within a software application.

learn more… | top users | synonyms

1
vote
0answers
55 views

How to store data that is recorded with different frequency?

I'm writing a metallurgical web application, that must store data (electrical parameters) recorded at different frequencies. For example: six parameters recorded with frequency of one measure per ...
2
votes
2answers
130 views

Best data structure to store data sorted alphanumerically AND by weight

What is the best data structure to store data sorted alphanumerically AND by weight (where weight is the first sorting criterion) with very low access time probably Olog(n) or better Application: A ...
3
votes
1answer
103 views

Merge directed acyclic graphs minimizing number of nodes

I have some DAGs (directed acylic graphs) and I want to merge them in order to minimize the number of nodes (we could say that every node has a cost, while edges are free). These four different DAGs ...
-2
votes
0answers
21 views

Persist and sync custom sorting information [on hold]

Assume a task app like asana with multiple client apps and the data must be synced across multiple systems. I have a list of 'tasks' and they can be custom sorted. What is the optimum way for me to ...
1
vote
2answers
143 views

Efficient datastructure to create size-limited dictionary

I need a class that acts like a dictionary but will constrain the total number of key/value pairs it contains. For instance, let's say the maximum number of entries is 1000 and the class already ...
20
votes
3answers
2k views

How do purely functional programming languages deal with fast changing data?

What data structures can you use so you can get O(1) removal and replacement? Or how can you avoid situations when you need said structures?
0
votes
1answer
131 views

I need a data structure for a card game

I am programming a card game in java, and unsure what data structure I should use for the player's hand. I considered using an array, with one integer to traverse the array and another integer to ...
1
vote
2answers
75 views

Complex data structure in python: just dict, etc, or some classes?

Consider a web service API that returns a complex Json object. Using the stock Python tools for the job, this will read in from the web service as a dict which contains, in turn, a mixture of arrays, ...
8
votes
2answers
535 views

How do personal assistants typically generate sentences?

This is sort of a follow up to this question about NLG research directions in the linguistics field. How do personal assistant tools such as Siri, Google Now, or Cortana perform Natural Language ...
0
votes
0answers
46 views

data structure with best match lookup

Let me explain my question with one example: I have the following structs: struct Box{ unsigned char color; unsigned double width; unsigned double height; unsigned double weight; }; struct ...
3
votes
4answers
1k views

What do you call an iterator that returns the current, previous and next siblings of each node of a list? [closed]

What do you call an iterator that given a list [a, b, c], returns an object of the form { prev, curr, next } for each iteration? e.g, (? === undefined) { prev: ?, curr: a, next: b } { prev: a, curr: ...
11
votes
6answers
21k views

How to quickly search through a very large list of strings / records on a database

I have the following problem: I have a database containing more than 2 million records. Each record has a string field X and I want to display a list of records for which field X contains a certain ...
2
votes
2answers
89 views

Is storing data directly in a list node better than storing a pointer to data?

Suppose we have two different doubly-linked list structures: One has content of the node embedded directly in the node: struct Content { // some stuff }; struct Node { struct Node *next; ...
8
votes
3answers
250 views

What data structure would you use to represent an organic compound?

Are there any good data structures out there that can be used to represent a molecule? I was thinking maybe I represent it as a Graph by making every atom a vertex, however, it's common for organic ...
-1
votes
0answers
21 views

Using Command Line Arguments to Choose a Datatype? [migrated]

Basically, based on whether a user inputs a 0 or 1 as a command line argument, I want my data class to either have a vector or an array (static) as its data member. I don't believe you can add if ...
49
votes
11answers
9k views

How to represent a Rubik's Cube in a data structure

If I am attempting to simulate a Rubik's Cube, how would you create a data structure to store the cube's state in memory, with X number of tiles per side? Things to consider: the cube can be of any ...
3
votes
2answers
151 views

Is it possible to speed up a hash table by using binary search trees for separate chaining?

I want to implement a Hash Table using Binary Search Trees to reduce the search complexity in the Separate Chaining process from O(n) (using linked list) to O(log n) (using BST). Can this be done, and ...
19
votes
2answers
13k views

Sets Data Structure in Golang

I really like google golang but could some one explain what the rationale is for the implementors having left out a basic data structure such as sets from the standard library?
2
votes
2answers
88 views

MaxHeap-like data structure supporting max AND min, also decrease-key (yes decrease-key)

For the purpose of implementing an optimization algorithm (finding the minimum of a multivariate function) I want to create a data structure that supports the following operations: load from array ...
0
votes
0answers
48 views

Enterprise Mashups. A good approach for .net

I'm in the middle of trying to talk our management into letting us do a portal that sits across the many, many systems that we use. I believe in using the best tool for the job so we have a good ERP, ...
1
vote
1answer
93 views

Non-fixed-size Fenwick Tree implementation

I'm planning to implement a non-fixed-size Fenwick tree. That is, a Fenwick tree that allows interleaving range queries with adding/removing elements. All implementations and samples I've seen so far ...
0
votes
5answers
494 views

Fastest way to determine if a value is in a list?

I'm aware there may not be a good solution to this problem. I'm looking for a fast algorithm that determines whether or not a value (let's say an integer) exists in a set of values, however I need the ...
0
votes
0answers
50 views

scrabble solving with maximum score

I was asked a question You are given a list of characters, a score associated with each character and a dictionary of valid words ( say normal English dictionary ). you have to form a word ...
0
votes
0answers
37 views

How to model dynamic table schema in .Net code

I am preparing to do an upgrade of a fairly large program that is currently written entirely in MS Access, both GUI and data (code and data in separate files). One of the key features of the product ...
16
votes
8answers
5k views

Is having trouble with data structures common for beginners? [closed]

I'm taking my second course on Java. We are getting into data structures. I have done an assignment on a linked list, and now a stack. I had a hard time with the linked list. The stack gave me a ...
1
vote
2answers
57 views

Passing context around AST nodes

I have various objects inside my AST, such as IfBlock, FunctionBlock, LogicExpression, etc. All of those objects share a context, which is basically a hashmap with some variables. It's a very simple ...
2
votes
0answers
63 views

Can't figure out class scheduling issue? [closed]

"You are a college advisor trying to help students plan their academic careers. You have the list of courses in each major and their prerequisites. Students often want to take their major courses as ...
3
votes
3answers
336 views

Is it worthwhile to try to write foolproof data structures?

The problem We need to store data in a table-like way, but we have very strict space constraints (~1Mb per table of 10k+ rows). We store data like this: ID | reviews | factor | score | interval | ...
45
votes
4answers
8k views

Which algorithms/data structures should I “recognize” and know by name? [closed]

I'd like to consider myself a fairly experienced programmer. I've been programming for over 5 years now. My weak point though is terminology. I'm self-taught, so while I know how to program, I don't ...
2
votes
0answers
27 views

IRLBot Paper DRUM Implementation - Why keep key, value and auxiliary buckets seperate?

Repost from here as I think it may be more suited to this exchange. I'm trying to implement DRUM (Disk Repository with Update Management) as per the IRLBot paper (relevant pages start at 4) but as ...
0
votes
1answer
77 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 ...
-3
votes
2answers
137 views

How to visualise this data model?

I have learnt different variants of list data model like Dlist, SList and recursivenodetype-list. But I could not understand/visualise this datamodel as mentioned below in C++ syntax, with an ...
8
votes
2answers
517 views

Is there any better approach to shortest path finding within a (vehicular) traffic network?

Dear fellow programmers, We're developing software which simulates vehicular traffic. Part of the process called "assignment" is concerned with assigning vehicles to their routes and has to use some ...
0
votes
1answer
56 views

Any good data structure to perform efficient lookup and modification operations about what are the shapes containing the current cursor position

I think I'm facing a pretty common issue but cannot remember which solution is the most suitable one. Let's put it that way: I can, in a, certain, given, language get some events anytime the user is ...
2
votes
1answer
198 views

When designing a data structure, should I implement very inefficient operations for convenience?

(I've added the .NET tags because the data structures are for .NET, and this question should be considered in the context of the conventions for that platform.) I'm writing a library of immutable and ...
0
votes
1answer
176 views

Is a linked list an actual data structure?

I hear conflicting sides from this topic. I was under the impression that a linked list was a way to implement a data structure (stack, queue), not actually a data structure.
1
vote
1answer
133 views

C# Structs, 16 byte rec. - Are getters and setters included in that?

I was reading into the nitty-gritty of structs in C# here: "C Fundamentals, The differences between struct and class." and at the very bottom it mentions keeping a struct below 16 bytes. I looked ...
0
votes
1answer
95 views

What's the algorithm should I use for seeing how well 2 strings match?

Suppose I have 2 strings: string1 = "home/lisa/Music/some_files/01.05 - Garden Ground.mp3" string2 = "Music/Jim Smith/Unknown/(Deluxe Version/Garden Ground).mp3" string4 = "Music/Jim Smith/Unknown/00 ...
4
votes
4answers
275 views

Why use an enum to determine node type in a parse tree?

The Sun Compiler Tree API uses an interface called Tree as the parent of all the different kinds of parse tree nodes (assignments, if-statements, class declarations, etc.). A part of this interface is ...
0
votes
2answers
318 views

Storing and retrieving simple data within a framework

I'm determined to get a decent answer to this, because while I have my own approach (constants) I'm not convinced I'm doing it as efficiently as I could be. So I'm editing the entire question, to ...
0
votes
1answer
158 views

Injectable, Poppable Stack

Background A project involves converting a relational expression map (rxm) to an XML/SQL statement. The map resembles: root > people, # "root" keyword starts the document ...
0
votes
1answer
48 views

Boundary traversal in binary tree

How to perform boundary traversal in binary tree using only single traversal of the tree? I am doing it in this way (not a single traversal): void printBoundary (struct node* root) { if (root) ...
0
votes
1answer
163 views

Best Data structure for implementation of dependent drop-downs

I want to implement dependent drop-down feature on a web page in my website containing the following drop-downs: User's group name Group events (dependent drop-down) Locations (dependent drop-down) ...
3
votes
3answers
219 views

Quadtree with duplicates

I'm implementing a quadtree. For those who don't know this data strucutre, I am including the following small description: A Quadtree is a data structure and is in the Euclidean plane what an ...
1
vote
1answer
50 views

Difficulty in deciding correct data structure

Two objects are interacting (Object Alpha, Object Beta) Each contain a point (x,y) which will be used to make comparisons, among other things. Object Alpha's point (x,y) attribute is dynamic and ...
1
vote
1answer
94 views

Data structure for traversing hierarchical hostnames

So, quite often I'll come across a situation where I'd like to process hostnames in a hierarchical manner. For example, given a hostname "foo.bar.baz.example.com", I might want to compare it against ...
1
vote
5answers
242 views

What would an anti-tree look like?

I am wondering if the Tree data structure has a dual. Something that 'starts at the leaves and converge on the root'. If so, what's it called? Maybe I'm missing something completely obvious. I could ...
2
votes
1answer
62 views

How Javascript Engines access/lookup property names?

How Javascript Engines access/lookup property names? what kind of associative array (data structure or search/lookup algorithm) did they use? (for V8, TraceMonkey, JSC, and Rhino) For example, in C++ ...
1
vote
0answers
122 views

Optimal data structure for binary data/Java

I have several input formats mostly restricted to geotiff and some proprietary binary formats. I import them into my program and then need to export them into various other data formats (also binary) ...
0
votes
2answers
57 views

Approaches to get stats like average latency in last N seconds

I am receiving messages with latency information (LI, {date, latency}). For statistical reasons: (I am open to approx. approaches, stats monitor will be updated in 6-60 seconds) I want to monitor ...