Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [data-structures]

Questions regarding efficient storage and representation of data within a software application.

-4
votes
1answer
80 views

Multi-level random selection implementation [on hold]

Structure I have a structure like this: level 1 items represented by a capital letter (A, B, C, D,...) level 2 items represented by lower case letter (a, b, c, d,...) level 3 items repredented ...
3
votes
3answers
174 views

What is the most effective algorithm to evenly distribute n points on a 2 dimensional array so they are as separated as possible?

I am trying to code a game which currently uses a matrix ( that I am calling a map). On this map are islands which can be generated n times. The purpose of the algorithm is to distribute the islands ...
1
vote
2answers
34 views

Best way to model assay steps with low variability?

I have to process biological data input in the format of 96-well plates. explainer for the non-biologists: These plates are basically a 2D matrix of 8 rows x 12 columns of small cups called ...
-1
votes
2answers
116 views

Help designing a product model with vast amount of properties

I've been asked how to re-design a legacy system by a relative for a company that builds custom chairs. On their website you can customize your chair in about 30 permutations : chair type, material, ...
1
vote
1answer
97 views

Simulate running/resting heart rate BPM

I need to simulate & output the human heartrate BPM with real-world like values. I've been looking at a gaussian random approach but don't believe this fits my use case. I'm not concerned about ...
0
votes
2answers
51 views

Marrying disparate datasets in stream

Caveat: I'm conscious that this question may not be a great fit for stack-exchange platform as maybe 'too broad' but will try & structure it that it helps people in the future I have 2 event ...
-4
votes
6answers
268 views

How to check for ID uniqueness on large dataset that can't fit into memory or on a single disk

Say I have 500MB of memory to work with, but 100 terabytes of IDs I want to generate. I want these IDs (GUIDs) to be randomly selected and applied to records, so they shouldn't appear in order when ...
2
votes
3answers
76 views

What is a good datastructure for localizable tags? (Like a blog post or questions at SE getting tagged with)

I am developing a web application where users can upload images and add tags to them. Because the audience is very international, I want the app as well as the content to be localizable. Most of the ...
2
votes
4answers
316 views

If the whole point of recursion is to break the problem into multiple smaller problems, what if those problems were solved in parallel?

So I was studying here and I was thinking if the whole point of recursion is to break the problem into multiple smaller problems, what if those problems were solved in parallel? A quick search lead me ...
0
votes
1answer
97 views

Encoding of timestamps over cosmological time (64-bit linear vs 32-bit logarithmic)

I understand this is the place to ask questions pertaining to software design. If my question is considered to opinion-based, is there a forum or something better suited for the discussion? ...
1
vote
1answer
31 views

Entity Relationship Model do I have to connect a table which is not using attributes from another table?

I tried creating an Entity-Relationship-Model, but I just don't get if I have to connect some tables and if I have to connect all, how do I connect tables which don't use attributes from another table....
0
votes
0answers
30 views

How to store metadata (e.g. table name) for a model class?

What is the proper way to get a metadata of the type in languages that doesn't allow static methods/functions to be overridden? For example, I'm using Dart: abstract class Model { // Constructor ...
1
vote
1answer
72 views

Does a microservice's individual database need to have complete data?

Say you have a Users and Orders service and they have their own database. Since microservices need to stand on their own even if another service is unavailable, does the Orders DB need to have all ...
1
vote
1answer
47 views

Database structure for an app used to capture data in warehouses

I am in the process of creating an android app for our clients that would replace the paper-trail in their facilities with electronic inspections. Although I have coding experience, I have little ...
2
votes
1answer
54 views

Tracking revision history by recording events

I've got a requirement to create a data structure that allows for users to view revision history. Not just the history of a table, but the history of the entire structure at a given point in time. A ...
29
votes
5answers
5k views

What is the most efficient way to store a numeric range?

This question is about how many bits are required to store a range. Or put another way, for a given number of bits, what is the maximum range that can be stored and how? Imagine we want to store a ...
0
votes
1answer
57 views

Data structure to group unique objects and support moving between groups maintaining uniqueness

I'm looking for a data structure that supports this use case - there must be one out there! A set of objects of type T can be stored in a Group, parameterised by the type T. A grouping has a ...
0
votes
2answers
97 views

Is this OOP class structure for an RPG good enough?

So I have built a Telegram bot where you can play a rpg. This is the class structure. Creature MobType <-- Creature Mob <-- MobType <-- Creature Mob1 <-- Mob <-- MobType <-- ...
-2
votes
1answer
137 views

How to obtain and store a subgraph of a graph in C++?

I have implemented a graph structure (for graphs having ~30,000 nodes and ~300,000 edges) as follows: class graph; class node; class edge; class graph { public: graph(){}; vector<node*> ...
0
votes
0answers
117 views

What kind of diagram best represents the field-level mapping from one system component to another?

In my environment, we have multiple systems developed independently by different teams. Those teams frequently recreate the wheel because they're building applications, not building blocks. As a ...
1
vote
1answer
212 views

What is the right algorithm to solve this problem?

The problem is - We have a series of boxes (A, B, C, D, ...). Each box contains bricks of different colours. For eg. Box A - red, blue Box B - blue, red, green ... and so on... and there are ...
2
votes
1answer
122 views

How to model workflows

I'm building a helpdesk-type system, where there are: Customer - can submit/resubmit tickets; Manager - can review submitted tickets, assign to developers (one ticket to multiple developers), review ...
1
vote
1answer
112 views

What is the best way to handle the scenario in C++ where there are two methods that are identical, except one is const?

I am currently working on a program in which I encountered an issue (not for the first time) where I have two acessor methods for a data structure. The methods are identical, except one is const and ...
2
votes
1answer
194 views

Which programming pattern is best for checking which partition a number lies in?

I have an interval partitioned into “MECE” subintervals, and I want to check which subinterval a number lies in. (MECE stands for “mutually exclusive & collectively exhaustive”, meaning the ...
1
vote
1answer
87 views

Explanation of how to resolve Hash conflicts in HAMT or hashtables in general

I am working on trying to understand HAMT and now am uncertain generally what to do when you run into a conflict in a hash. All I understand so far is you create a list to append the keys to, but I ...
5
votes
1answer
120 views

Working with “external” object IDs

I have often encountered a situation in which users of a program (not necessarily human, just an external agent) need to be able to reference objects of a class with a certain "external" identifier, ...
-2
votes
2answers
134 views

How to handle multiple versions of binary file format

I'm writing a reader for the custom binary file format used in one game. The format has multiple versions for example: struct FileHeader { ushort version; uint fieldX; // version 1 uint ...
0
votes
2answers
106 views

Some Suggestion about Data Modeling

I want to make a social game for Android. I am using NoSQL Based Database (MongoDB) and I am using NodeJs. I am using Android-Volley library to make POST and GET requests. But I am stucked on ...
4
votes
2answers
240 views

How can one interpret an Abstract Syntax Tree without recursion?

I am busy building an interpreter for a Rebol-like language. I have previously built a Lisp interpreter where I used recursion, but now I just want to use a stack and not rely on the recursion ...
0
votes
2answers
73 views

What is the best method to avoid company data duplication in mixed B2C and B2B product in account creation?

I'm building a user license portal, store, SSO, and mini CRM and admin for internal people to manage those users for a niche 3D software company, similar to Autodesk. Licenses are sold to both ...
2
votes
1answer
153 views

Do we include output space in space complexity?

For example. I have a function which generates an array with random numbers. int[] generateNum(int n) { int[] result = new int[n]; /* Logic to generate random number */ ............... ...
0
votes
1answer
51 views

How a Merkle tree can work with Graph data, or a better data structure

I am looking at blockchain and trying to see how Merkle trees (or perhaps Merkle DAGs) can fit to a graph data structure with circular references. For example, say I have this data model: var ...
0
votes
1answer
148 views

Efficiency in Java: Object reference vs id reference

I have to represent a certain data structure, in which I have nodes that are related between them. Each node has its numeric id, and a list containing the next directly related nodes and another list ...
0
votes
0answers
20 views

How to combine multiple Tries for complex searching and filtering across tables?

Say I have a database with 100 tables. Scattered throughout the tables are some string columns for short things that could be considered usernames/tags/categories/hashtags/addresses/placenames/other ...
1
vote
1answer
38 views

Data Matching In VBA - Best way to deal with dynamic data and user entry?

Background I am currently building this project with VBA, just to keep in the back of your mind when thinking about my question. Imagine 2 adjacent blocks, in Excel. The first block is made up of ...
-6
votes
1answer
36 views

Give a list of a from area code and to area code and a distance between them,which data structure?

What data structure i can use to lookup given a fromCode and toCode apart from hashMap which results in more number of entries in the memory. We are ok with log(n) efficiency also. Example data: ...
2
votes
2answers
126 views

How to structure database for daily events?

I'm storing data which logs whether or not a user has logged their attendance for a given day. Some days are unimportant (holiday, weekend), so those are also stored. The two requirements are that: ...
4
votes
2answers
256 views

Game Playing AI - Strategy to overcome the transposition table taking up too much memory?

I've made an engine that plays Connect Four using the standard search algorithms (minimax, alpha-beta pruning, iterative deepening, etc). I've implemented a transposition table so that the engine can ...
-1
votes
2answers
401 views

How to represent a directory structure in a binary tree?

I was just thinking about implementing a binary tree with its root pointing to the parent folder and then the children pointing to subdirs nested within to store a directory structure in a binary tree....
2
votes
1answer
103 views

Achievement System CRUD data structure

I'm developing this Achievement System and it must have a CRUD, that admins access to create new achievements and it's rules. I need some help with the Achievement CRUD data structure. Rules sample ...
-3
votes
1answer
82 views

How to determine the collection type without access to the source code [closed]

How could you determine if a collection is implemented as an array or as a linked structure without access to the source code (assuming you can run the code)?
2
votes
2answers
160 views

Finding an efficient data structure and/or algorithm

I am tasked with an animated graph based on a timeline, and I am having trouble finding a suitable data structure and/or algorithm that's reasonably efficient. I have a working system suffering from ...
1
vote
1answer
73 views

A table for each field type or one all-in-one table model?

I am creating an application where users can create forms with many fields of text, numeric, date and select types. The model will have a forms table referenced by responses table; It also have the ...
1
vote
1answer
140 views

Managing heterogeneous data

The underlying problem is one I seem to run into a lot. You have a collection of objects with some things in common, but other information about the objects may apply to some of them but not to others....
1
vote
1answer
42 views

Dictionary Application: Suggestions for serialization format and data structure

I want to create a dictionary application. One of the design guideline is performance in querying and showing up the definitions of words. I would like some suggestions on two design choices: Which ...
0
votes
2answers
62 views

What are formats to store geographic maps for a robot to travel point A to point B

Very beginner. Need to compute route from A to B for a robot. i would like to know how to store area map and compute the route. I can compute shortest path etc using algorithms e.g. dijkstra. What ...
1
vote
1answer
249 views

Binary Search Tree with ID and Duplicate Values

I'm having trouble finding resources for this implementation I'm trying to figure out. I want to save nodes in a binary search tree (self balancing) containing an ID and value struct Score { int ...
2
votes
2answers
415 views

Can nested loop have linear time complexity

I was going through the traditional quick sort algorithm. I had a look on the partition algorithm in a couple of places and the implementation difference was very subtle. Here are the 2 approaches: ...
0
votes
1answer
67 views

Data Structure to join points by similarity measure

I have a series of points (x,y) and each point has a colour (in the LAB colour space). I need to associate points by similar colour and then spatially. So the end result is each point becomes part of ...
-2
votes
2answers
47 views

database/orm model design for contacts

I am building a internal crm which has contacts which are just people with first name, last name, email, phone etc. Contacts can be one or more types e.t.c. job candidates, hiring managers, customers, ...