Questions tagged [data-structures]

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

Filter by
Sorted by
Tagged with
2
votes
1answer
65 views

Techniques for handling large reporting periods in MSSQL

We have a fairly large database with some fairly large tables (100s of millions of rows). Some of those tables are reported on. We have indexes in place to make this as fast as possible, but still ...
2
votes
2answers
62 views

How to model files which contain values that depend on and change with other values?

I want to parse a binary file and track the values and positions of certain properties within it. Reading them is not that much of a problem, since I know the rules they follow in terms of where they ...
2
votes
3answers
224 views

What is the name of this concept/design pattern for blocking another component from running?

Description of Desired Behaviour I have the following scenario: Component A can run freely as long as it is not blocked. Any other component can block the component A from running at any time. ...
-3
votes
1answer
87 views

How to do data design without database? [closed]

I already to do research on internet about data design, they all explain how to do data design with database. But how to do data design without database? example i want to do data design for embedded ...
2
votes
1answer
61 views

Storing and filtering spatial data within RAM

I'm trying to figure out what's the proper way of storing and filtering spatial data inside a running program. I have a 2D map of theoretically infinite size. Users generate objects which are placed ...
0
votes
0answers
19 views

Inspiration for Storing Error Codes and other State inside the “Value” of a bitarray

I am playing around with a toy database based on a large bitarray. I am considering storing special things inside the value (encoding sorta like a VLQ, Variable Length Quantity). Things like if the ...
1
vote
1answer
64 views

Converting binary tree into doubly linked circular list

I am a beginner in computer science and have been asked to write a program to convert a binary tree into a circular linked list (order of the nodes in list are in inorder traversal of the tree). I ...
1
vote
1answer
38 views

Ternary search tries vs. r-way search tries with hashtable child node list

I was watching the Coursera algorithms lecture series' portion on tries. R-way tries are introduced first, where each node has an array the size of the possible character space (R) with potential ...
1
vote
3answers
191 views

Are 'array elements' and 'array values' the same?

Array := {"title": "Book Title", "author": "John Doe"} Some people use the following terminology: title and author are keys. Book Title and John Doe are values. "title": "Book Title" and "author": ...
0
votes
0answers
10 views

Recommendations about Designing DDS Topics for IO Controller

I have an IO controller device which has up to 120 digital inputs/outputs. I want to use DDS to read inputs and to write outputs of the device. I have no idea how topics should be created. I mean, ...
1
vote
2answers
96 views

Tree data structure where children can only be added based on their type

I have a tree data structure where each node has a name, an id, a type and a number of children. Additionally each node has properties based on its type. Thereby each node with type A should only ...
3
votes
1answer
73 views

Is a generic data structure customary for use in a self contained program, or can I duplicate source files?

I have a project that does some Dijkstra searches on a graph, I implemented a red-black tree and priority queue that I use for the nodes, however I also need the same data structures for other things ...
1
vote
1answer
142 views

Does a Self-Balancing Self-Sorting Binary Search Tree exist?

When we are inserting into a self-balancing tree, can we also assume it is sorting itself using those same operations? Or rather is there a traversal method that gets us the elements as a sorted list?
2
votes
2answers
93 views

Is it allowed to calculate the derived attributes by using other tables' attributes directly?

I tried to build a database for Driver Booking system. Here's brief details: Drivers have several vehicles and they offers the driving service with them Drivers will charge different hourly rates on ...
0
votes
0answers
45 views

Most performant way to store and find overlap in (coordinate, id, time interval) triples

Let me explain what I'm doing. I have a grid based on integer coordinates like (5,5), (5,6) etc., and I have an algorithm FindCells that generates a list of (coordinate, interval) tuples. These ...
2
votes
1answer
222 views

Flexible (dynamic) user input vs statically typed language c#

Problem domain: There are different types of financial products and I am trying to simulate them in different scenarios. Each of the product types requires different input data. Suppose the input ...
2
votes
1answer
100 views

Designing the schema for a database of Spanish language words?

For a project I'm working on that will help people learn Spanish, I would like to create a standalone service to handle the retrieval of data about words. For this, I've captured and codified data ...
2
votes
1answer
45 views

Data modeling user-object permissions, between claims and metadata

I've been thinking about how to map user claims to permissions in a way that scales from a read and write perspective, probably using a stand-alone service. What we have today doesn't scale for ...
0
votes
0answers
55 views

What is the correct way of setting and then differentiating between paid and free user in Firebase / Firestore?

I am developing a mobile application that will have both free and paid versions. The way I see how I could differentiate between what is a paid and free user is to set a property isPaid on their ...
1
vote
2answers
94 views

How to manage item locations in an inventory

I have to manage item locations and life cycle as a new requirement. I'm not familiar in warehousing/inventory/storage systems, so maybe my question is trivial. The task: We have original items that ...
0
votes
2answers
108 views

Ordered data structure with efficient push, iteration and random pop/drain

I need a data structure d with somewhat conflicting requirements. What are the different tradeoffs I could pick? The same algorithm will be repeatedly done on each time step: push one new element to ...
1
vote
2answers
132 views

Architecture/algorithm for unusual recommendation system

There are thousands (or tens of thousands) of possible movie titles. New user enters my website and selects hundreds of titles that he likes. The only single goal of my website is to output the list ...
0
votes
2answers
147 views

What are the “scalar fields” and “composite fields” in JAVA?

Need to understand the below definition, from the protobuf tutorial: mergeFrom(Message other): (builder only) merges the contents of other into this message, overwriting singular scalar fields, ...
-4
votes
1answer
103 views

Exiting Recursive Function C++ [closed]

In the following function IsDoubleString(),if res is true then it shouldn't call IsDoubleString(), I debugged the code but I am unable to understand that once it hit the line returns res; why does the ...
1
vote
1answer
192 views

Designing an Entity Component System for interfacing with a scripting language

I am currently building an Entity Component System (ECS) in cython in order to speed up operating on large numbers of game objects in python. In the process of building this system, I ran into the ...
0
votes
0answers
52 views

Maintaining data: Unprocessed data, processed data, and results from processed data

I have built a python process which automates some portion of handling support tickets in Salesforce. I use selenium to extract all open support tickets and stores them in an archive. From that list,...
0
votes
0answers
16 views

spatial element count data structure eg: R-Tree, with filtering

Background: The application is a web map application with a LeafletJS front-end and NodeJS back-end with Postgres database. The application is to be used on both desktops and smartphones/ tablets in ...
-4
votes
1answer
92 views

Multi-level random selection implementation [closed]

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
335 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
38 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
123 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
123 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
55 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
7answers
294 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
91 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
5answers
503 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
104 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
35 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
37 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
103 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
57 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
65 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
60 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
132 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
258 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
139 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
217 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 ...
3
votes
1answer
128 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
136 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 ...