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

learn more… | top users | synonyms

2
votes
1answer
67 views

Matrix multiplication range queries

I have a huge list of matrix i.e A = {M0, M1, M2 .. Mn}. I have a task to find the product of all the matrices in a given range {x,y} i.e Mx * Mx+1 * Mx+2 ... * My. I would like to know if there is ...
1
vote
2answers
124 views

What design patterns exist for large dataset manipulation within MVC for a rich client data grid?

I want to feed an HTML5 data grid with large data sets that the client will want to manipulate in different ways, e.g. aggregation, grouping, pivoting. The data comes from different web services and ...
-2
votes
4answers
69 views

How can I represent a multi-dimensional grid? [closed]

I'm trying to find an efficient way to represent a grid in any number of dimensions. I would want to be able to specify a set of coordinates and then get the value stored in the location on the grid. ...
5
votes
1answer
98 views

How does cuckoo hashing guarantee O(1) lookups in presence of persistent hash collisions

Most hash table implementations guarantee O(1) average case but O(n) maximum case for lookup (where 'n' is the number of keys in the table). But Cuckoo Hashing is described as O(1) maximum. ...
-3
votes
2answers
58 views

class name for linked lists

I have a question about how to name a class in java. Could a class name be arbitrary or have to obey some rules? For example, I want to define linked lists in a class, does the class name have to be "...
1
vote
1answer
29 views

File structure for storing pixels that changed from one image to another

Have two images with the same dimensions. I want to create a file that contains information on what pixels are different between the two images. The file should also tell me the value of the new ...
1
vote
0answers
82 views

How to structure enum data to achieve the desired effect

I'm making a framework for building simple html websites for an embedded system and I want to make it bulletproof in a way that a user can't make mistakes in building the html document. As I've ...
4
votes
2answers
178 views

Can StringBuilder be used to effectively store and manage multiple variables of data?

Using C# I want to create one or more text files to store all the data pertaining to a particular 'Thing' on the same line. I am presently leaning towards StringBuilder as per the following. sb....
1
vote
1answer
67 views

How many vertices/nodes are too many in a graph and stop being beneficial?

Background I'm working on a project that requires me to keep track of transactions as well as the flow of items in a game. In order to do that, I'm storing those transaction in a graph db (Orient-DB)....
2
votes
2answers
160 views

C++ object references vs. lookup

Let's assume there are 2 classes: Country and City. Both of them have names, so a map would suit as conainer map<std::string, Country> countries; In the country class there is a similar map ...
2
votes
1answer
109 views

What method for storing a text file in memory (c not c++) would allow me to open any format(UTF-8, Binary, etc) and a file of any size?

My first thought here is to use a dynamic array, but I am looking for something better. Currently I have the text files open into "chunks". Every word or group of spaces makes up a "chunk". Then I ...
1
vote
0answers
24 views

Pagination with multiple groupings

I have a data model that looks like this: Group 1 --Sub group1 ----item1 ----item2 ----item3 --Sub group2 ----item1 ----item2 ----item3 Group 2 --Sub group1 ----item1 ----item2 ----item3 --Sub ...
3
votes
1answer
97 views

PHP OOP, structuring my objects properly

I have an architecture similar to this: User (Name, Email, ID...) ---- Studios (Name, Location, Description...) ---------- Videos (Title, Description, URL, Length, Views...) Simply put, a user can ...
0
votes
2answers
52 views

How to model a property with two different formats and ranges

I am designing a JSON based data schema to describe the visual appearance of blocks similar to HTML elements. It should feel familiar for somebody knowledgable in HTML/CSS but is more restrictive due ...
3
votes
1answer
367 views

What do banks actually use as a data type for money? [closed]

I'm aware of a few good options: Big integers (e.g., int64_t, mpz_t, any bignum lib) to represent cents or 10-n cents—say, an integer represents 1/100 of a penny ($1.05 == 10500). This is called a ...
0
votes
1answer
99 views

Data Structure for Form or Survey [closed]

I am planning an app which allows users to complete surveys/forms. I'm having trouble planning the data schema for the forms. I really want to have a data structure which can be mostly automatically ...
3
votes
2answers
351 views

Can a tree be used to create a stack?

I'm aware that linked lists, sets and arrays can be used to create stacks by themselves. The theory behind it is this linked-list: In some languages, a linked-list is substitutable for an array. ...
-2
votes
1answer
57 views

Considerations when making data structure and algorithm choices [closed]

What are some reasons you may choose a worse runtime algorithm? And what are some advantages of a linked list vs a hash table/array where access is constant time.
2
votes
1answer
145 views

Standard System that connects to any datasource without much/any source-specific code?

We are a small team doing work on a LoB system that needs to connect to varied systems such as ERPs and CRMs to extract business processes like invoices, customer info, production orders and the such, ...
1
vote
2answers
57 views

DB Design for non static front-end

I have a question about best practices to design a database which have to hold the following data: There is a page with a questionnaire which has default questions like Firstname, Lastname, Street... ...
5
votes
1answer
153 views

Is it possible to have these characteristics in a data structure?

I was tutoring a student that came up with this assignment. It basically requires a data structure with the following characteristics: it holds a set of integers in {1, 2, ..., n} n is power of 2 O(...
7
votes
2answers
335 views

Is using this complex data structure bad practice?

Right now in my current company I must "parse" a csv and extract some data out of it (in the sense of data mining). I surprised myself by defining the following data structure (Java 8): static ...
6
votes
6answers
275 views

Should I always store parsed data in database before manipulating?

I am about to start a new project which involves taking an excel file, parsing the data (php-excel-reader) and then using the parsed values in a HTML email. My question is pretty simple. Is it better ...
10
votes
4answers
353 views

Is there a standard way or standard alternative to packing a struct in c?

When programming in C I have found it invaluable to pack structs using GCCs __attribute__((__packed__)) attribute so I can easily convert a structured chunk of volatile memory to an array of bytes to ...
2
votes
1answer
150 views

Suggestions for structuring complex json structures?

I can't find many tips for how to design complex json structures beyond the obvious tips of not trying to nest too deeply, using defined data types, etc. For example, if I have a location that needs ...
3
votes
3answers
92 views

Is it odd if Nodes in a LinkedList held references to the List object?

Its like, I want to call .moveToBefore(Node) on a Node object and have the node relocate to before the node passed in. The problem arises if the node passed in is the head node. The List object will ...
5
votes
3answers
146 views

How to create “constructors” for structures in C

The problem I have this structure that I want to create a "constructor" for it. struct example { int x, y, z; /* various members */ struct another *another; /* pointer to another structure */...
0
votes
0answers
19 views

Joins between datasets in data models

I'm struggling to understand how to join data between data domains in application properly. Say, I have three domains, User, Post and Like: User - id - login - password - active - ... Post - id - ...
0
votes
0answers
45 views

Bounded Priority queue with constant time amortized delete min and insert

Given a bounded priority queue (with keys between 1 and k), is there any data structure with amortized constant time for delete min and insert and find min, where the worst case time for these ...
-2
votes
1answer
90 views

Should I be using XML to store configuration values in a database?

There are a couple of answers on SE comparing single-row table vs. name-value-pair table used for config settings, but I haven't seen anyone arguing for using XML (or JSON) as a name-value pair ...
8
votes
2answers
344 views

Workaround for implementing operations on doubly linked or circular data structures in languages with immutable data

I would like to learn how to make graphs and perform some local operations on them in Haskell, but the question is not specific to Haskell, and instead of graphs we may consider doubly linked lists. ...
9
votes
4answers
489 views

What is the most efficient way to store this data?

I am in charge of rewriting some old VB code. I understand how it works, but I feel like there is a far-more efficient way to do what they did. I just can't figure out what it is. Here is a contrived ...
1
vote
1answer
40 views

Efficiently determining many-to-many subset relation

I'm doing market basket analysis. I have a set of transactions. Every transaction is a set of items that were bought. I then have a set of itemsets (i.e. a set of items) that I want to determine the ...
-1
votes
1answer
121 views

Comparison of Red/Black Tree to Java ArrayList, what are advantages of each? [closed]

I was looking over some of the general Big-O Algorithm Complexities for different data structures, and wondered what Java's ArrayList would be considered. Since I tend to default to an ArrayList in ...
3
votes
3answers
118 views

At what volume is a specific data structure considered useful

I had this discussion with co-workers before. We had to store users by id and we'd do mostly Add/Get operations on it. I proposed to use a Dictionary which seems like the logical choice. My co-worker ...
0
votes
1answer
59 views

Data structure for effects animation? [closed]

I'm making a prototype for a game. I'm working on effects at the moment, but more generally animation. Currently, I have list where newly spawned effects are added to. Then on the update section ...
-1
votes
2answers
77 views

Abstract Syntax Tree with parent or not? [closed]

My question is as simple as the title says -- should I implement AST with parent or not? Currently I implemented it with parent -- the benefit of that approach is, that whatever I use, I can go up or ...
0
votes
1answer
97 views

Why aren't data structures like BSTs part of the core libraries of more languages? [closed]

For example, why doesn't JavaScript provide a BST as a native data structure you could use? var bst = new BST(); bst.insert('5'); bst.insert('3'); bst.find('5'): Alternative question: what are the ...
4
votes
2answers
147 views

Sort a list while putting together or after?

I have to read through an extremely large amount of network data from various log files, and compile relevant information about that data to perform statistical analysis on it (the top communicators, ...
0
votes
0answers
90 views

Best datastructure to use

I am using Amazon's dynamodb nosql database and as a result I need to think of some ways to do certain operations to fit into their limits (e.g 4k item limit, can't combine small items into the same ...
0
votes
1answer
37 views

What structure has nodes with inputs and outputs? [closed]

If I have a bunch of nodes with differing numbers of inputs, but only one output, and each output can go to multiple inputs, but only one output per input; what do I call it? Trying to name a class ...
3
votes
2answers
203 views

Design pattern for fetching data in chunks

I am creating Qt application that uses database with huge amount of data to draw some charts. Fetching data from the database is time consuming, so is blocking the application thread or worker thread ...
3
votes
2answers
178 views

Should Linked Lists always have a tail pointer?

My understanding... Advantages: Inserting at the end is O(1) instead of O(N). If the list is a Doubly Linked List, then removing from the end is also O(1) instead of O(N). Disadvantage: Takes ...
3
votes
1answer
142 views

What Lisp data structure to use?

I am studying different language games and trying to implement them in Common Lisp. Currently, I am studying a game which studies the relation between forms and meanings. An agent needs to store the ...
0
votes
1answer
232 views

Merging Two Binary Search Trees

What time in terms of Big O will it take to merge two BST's in One? Each having no of nodes n and height O(log n) with no common element. Resultant should be also a BST
32
votes
5answers
5k views

Why is deletion usually much harder to implement than insertion in many data structures?

Can you think of any specific reason why deletion is usually significantly harder to implement than insertion for many (most?) data structures? Quick example: linked lists. Insertion is trivial, but ...
1
vote
2answers
73 views

Objects with boolean data type

I have a collection of objects, and for each of them I need to know if a specific condition has been met. That is a ternary condition, it could be not yet tested, tested and failed, or tested and ...
3
votes
3answers
497 views

How can I represent a flowchart, complete with conditional logic using JSON or XML?

One part of a project I'm working on is interactive scripts for call centre staff. Pretty much every possibility I can think of in this case can be represented on paper as a flowchart, which is why I'...
2
votes
3answers
196 views

How does google calculate travel distance/time

I've been working for quite a while now on a service that generates optimal routes for a given set of addresses and vehicles (Vehicle routing problem / traveling salesman problem). Now it's all ...
4
votes
1answer
899 views

Why is there not a basic SortedList<T>?

As far as I know, there is no way to get a List<T> with the capacity to sort itself. If I add a element, I want the data-structure to insert it in the right position (based on the associated ...