Skip to main content

Questions tagged [data-structures]

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

Filter by
Sorted by
Tagged with
-1 votes
1 answer
66 views

Designing a Distributed System for Indigenous Data Sovereignty Across Nations [closed]

I'm looking for some quick "back-of-the-napkin" thoughts from systems engineers on the following scenario: A collection of Indigenous groups (in the US, Canada, and Australia) want to design ...
Jordan Loewen-Colón's user avatar
3 votes
3 answers
366 views

Encapsulating a central soap service in a microservice?

I am currently developing an application (rest-backend and SPA) that requires information from people (personal data, department, superior... ). Our company has a central directory for this purpose. ...
Phoenix's user avatar
  • 67
1 vote
1 answer
65 views

How to reuse parts of a Trie data structure (like a Trie DAG)?

I am playing around with a cross-language spell-check sort of thing, and am still in the prototyping/ideation phases. Basically I have thought of something like a Trie data structure, but I keep ...
Lance's user avatar
  • 2,605
0 votes
1 answer
116 views

Elegant way in C to store many parameters with default value and current value in embedded flash

I'm programming an embedded system that has a number of user configurable parameters, which are stored in flash memory. I have to store a default value for each parameter as well as the user settings. ...
jusaca's user avatar
  • 175
0 votes
1 answer
153 views

Best practice - depending on object key iteration order?

In Javascript, the iteration order of an Object is enforced since ES2020 (or before, depending...). However, is it a good idea (i.e. best practice) to depend on this? I'm currently working on a ...
Kricket's user avatar
  • 723
1 vote
0 answers
176 views

Implementing a memory efficient Abstract Syntax Tree

I am writing a compiler in C++ 20. I am looking for ways to improve heap memory performance. For example, I can compile a 36.8 MB source file that is just many repeating lines of: let x0: string = &...
Wesley Jones's user avatar
2 votes
1 answer
153 views

Wondering about ADT abstract data classes in Python

I am trying to learn a little Python by myself and came accross this book Data Structures and Algorithms Using Python Rance D. Necaise 2011 , to get some proper/formal/correct definitions/terminology ...
pippo1980's user avatar
  • 137
3 votes
4 answers
1k views

Representing vectors as arrays of points vs. as data structures

I'm writing a program in Java where I need to represent the position, scale, and other 3-dimensional properties of objects in a world using vectors. I can use either of these two approaches: ...
AcinonX's user avatar
  • 613
-2 votes
1 answer
229 views

Making objects aware of their (consistent) IDs

Abstracted problem I would like to be able to quickly refer to some (most likely non-hashable) objects. At the same time, I would like them to be aware of their own identity. The 2-way search should ...
Etua's user avatar
  • 7
5 votes
9 answers
3k views

Methods to increase the amount of data sent in a packet

I have been working on launching high-altitude balloons (HABs, or weather balloons) and I have been using LoRa to enable long-range communication with my balloons. It's been great and pretty reliable, ...
Lv_InSaNe_vL's user avatar
1 vote
1 answer
305 views

Tagged pointers vs. fat pointers

I'm writing my own dynamic programming language. So far I've been using a tagged union for all values. Since this boxes primitive types needlessly, I've begun researching tagged pointers which seem to ...
Matheus Moreira's user avatar
0 votes
0 answers
81 views

What is the Big O notation of modifying an existing element in a heap data structure?

Wikipedia says "increase key" is O(log n) for a binary heap, but it is referring to an internal function. I'm not asking about that: Imagine the data structure had an external/public ...
Daniel Kaplan's user avatar
1 vote
1 answer
206 views

Unordered Map with indexing and range based loops [closed]

I am creating a C++ library (more of a passion project to be honest). Its aim is to enhance the existing unordered_map STL by giving it indexing abilities and range-based loops, based on the order of ...
Aaditya Yadav's user avatar
1 vote
1 answer
154 views

High Throughput Concurrent Map Access and Periodic Updates Causing Contention and Latency Spikes

I am working on a Go application where two concurrent maps, products and productCatalog, are accessed by numerous threads in live traffic to retrieve data at high throughput. These maps are populated ...
dragons's user avatar
  • 121
10 votes
6 answers
4k views

How to ensure data consistency in system with multiple databases?

Let's say, in a rather big application suite with multiple more or less integrated products, data is stored across multiple databases. Some of them are SQL-ish DB clusters, some are MongoDB clusters. ...
cis's user avatar
  • 255
0 votes
1 answer
259 views

C++ creating a class with self referencing custom comparator [closed]

This is the node for a tree class Node { public: string name; map<string, string> attribute; Node* parent; set<Node*, customComparison> children; }; Where customComparison in ...
Tychus Findlay's user avatar
-1 votes
1 answer
381 views

What is the best way to store a recursive data structure? [closed]

What is the best way to store a recursive data structure in a program? (in C++) I'm reading data from file, and want to keep it in memory while I validate the data and the user can manipulate it. It ...
masher's user avatar
  • 107
0 votes
1 answer
131 views

Why is `WeakSet` great for tracking circular references?

In MDN article on WeakSets, an example is given for using weak sets to avoid infinite recursion on circular references: // Execute a callback on everything stored inside an object function ...
Anton Strogonoff's user avatar
6 votes
2 answers
647 views

Object immutability and persistence

While I was learning functional programming I have encounterd two for me very similar terms: immutability and persistence. Also I have read simular questions from stackoverflow, but I am still ...
DimitrijeCiric's user avatar
0 votes
2 answers
82 views

How do I control many datasets that are related and can change independently?

Background: I'm a scientist working with a small team on data analytics. No one on our team has any experience with software engineering, though I'm trying to change that. Suppose I have an array A ...
coney1's user avatar
  • 87
0 votes
1 answer
169 views

Trie data for searches in time ranges

I am developing an API responsible for returning the distinct searches made on a service given a date prefix. Example data: 2015-08-01 00:00:18 %22http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%...
alves's user avatar
  • 101
0 votes
1 answer
438 views

How is it possible to store the AST nodes location in the source code?

I created a simple parser in Rust and defined the AST like this: enum Expression { Number(i32), BinaryOperator(Box<Expression>, Operator, Box<Expression>), Identifier(String), }...
Iter Ator's user avatar
  • 111
-2 votes
1 answer
65 views

Assigning Relationships between various objects in a collection

Similarly to a sports team chemistry or even a better example would be fifa ultimate team chemistry where putting certain players in the team would improve the team's overall chemistry Say there are ...
user2921885's user avatar
0 votes
1 answer
174 views

Are self-written queues and linked lists really worth it (better than built-in arrays)?

Let's say I need a queue for my project and the language I use does not have a built-in queue structure. So I decided to implement one myself. So I create an object with elements positions as the ...
forty5's user avatar
  • 39
0 votes
2 answers
446 views

How to create an interface in C that can work on two identical structs with differently named fields

Question Background Consider a scenario in which I have two structs. Both consist of three fields for doubles. The only difference is the names used to refer to these fields. The first struct is for ...
Shadow43375's user avatar
0 votes
1 answer
112 views

How is model reconstructed with event sourcing in CQRS principle?

I'm trying to understand the CQRS design. As far as I know now, every time a change to a model is saved, the (state) change is stored as a separate record. When reading a model, the model is ...
user2190492's user avatar
-3 votes
1 answer
687 views

What's the right data structure to combine iteration of key-value pairs, and iteration of values

I'm looking for a pre-existing or easy-to-build data structure available in Java, which can do these 2 things efficiently: Fetch all the values stored in the collection quickly. Iterate over the data ...
sbhatla's user avatar
  • 167
13 votes
2 answers
3k views

Is there a common term for a fixed-length, fifo, "push through" array or list?

Here's a ubiquitous data structure in, say, game and UX programming: there're a fixed number of items (say, "5") they're all "zero" to begin with you can put one in on the "...
Fattie's user avatar
  • 437
-1 votes
1 answer
33 views

How to model multiple requirement scenario

I want to store and analyze university course requirements. Lets say, students to register for ABC123 course following requirements should satisfy. Must pass CBA321 Should be taken with XYZ123 Must ...
Sachith Muhandiram's user avatar
3 votes
4 answers
905 views

Iterating through stacks and queues?

Are stacks and queues allowed to be iterated over, conceptually? It “feels wrong” for some reason but I can't come up with a reason why it would be bad to see through the whole thing that's stacked/...
Lazar Ljubenović's user avatar
2 votes
3 answers
202 views

Eliminating combinations based on user input

I am stuck with this particular problem. To give context to the problem, I am developing a mobile app which helps with loading dangerous goods onto a truck. Ignore the size and weight of the dangerous ...
Saul Goodman's user avatar
3 votes
3 answers
316 views

What are the existing theories or methodologies around synchronizing tree structures?

I need to compare and synchronize two tree data structures. I have Tree A (the "Reference Tree") and Tree B (the "Target Tree"). I need to bring the Target Tree into compliance ...
Deane's user avatar
  • 171
0 votes
1 answer
176 views

How is B-Tree used in DBMS-s if WHERE condition can be anything?

The most of the database management systems use B-tree as a data structure for increasing the performance. Let's imagine that we have a table users with the following columns: id (int), name (string), ...
Vega TV's user avatar
  • 111
1 vote
1 answer
296 views

Best practise for designing REST API endpoint that accepts a nested resource POST

What's the recommended design for an endpoint that accepts a nested resource as the following: POST /account { "name": "Project John Doe", "description": "...
user2190492's user avatar
0 votes
0 answers
160 views

Is there a known algorithm for reducing a tree based on a list of its leaves?

For a given, tree-like data structure: - Alan - Barbara - Charlie - Cecil - Brian - Chris - Candice - Cohen - Boromir - Corcoran -...
StuperUser's user avatar
  • 6,123
0 votes
1 answer
91 views

Help required in the right data structure for faster look up of data

I have the below given data model itemid - name - collectionitemid example: itemid |name | collectionItemId ------------------------------- 101 | abc | null 102 | def | 101 103 | ghi | 101 ...
Saran's user avatar
  • 11
1 vote
2 answers
1k views

Efficient data structure to index a collection of unique values shared among objects

I have a collection of many millions of objects, each with a unique id, each composed of tens to thousands of values. Values in this case are simply arrays of floats, with dimensions in the tens to a ...
alkonost's user avatar
56 votes
7 answers
12k views

Why do so many standards for JSON API response formats contain a "success" property in the response body instead of just using HTTP status codes?

I was researching about best practices for standardised JSON response formats for APIs, according to various sources available online general consensus looks something like this: //Successful request:...
Šime's user avatar
  • 679
0 votes
1 answer
2k views

Why is there no Hashmap in C++ like Java? [closed]

I know that the C++ standard library includes the ordered and the unordered map (std::map and std::unordered_map) containers, but why is there no hashmap available on C++? I was asked this questions ...
Swayam Shah's user avatar
1 vote
0 answers
424 views

Design MySQL database to store user workout data for Workout App

I am building a fitness app and I'm trying to figure out the optimal way to store the data is a MySQL database. I would like to have specific programs (for example, 'get jacked'), I would like a users ...
adherb's user avatar
  • 121
0 votes
1 answer
92 views

Data Class: spread boilerplate for each different database over multiple class copies, or add complexity to original class?

I'm creating a prototype mobile app that will store data locally in an sqLite database and also on the cloud (CloudKit for now). The cloud storage uses a certain way of storing the data, and sqlite ...
Adam B's user avatar
  • 1,645
0 votes
0 answers
43 views

Query for each doucment or include IDs in document itself and query for all documents with ID?

I am working on a project where there will be different kinds of accounts that use Auth0 for auth and authz. I want to have it so that an account will query my backend to get back documents that ...
joshk132's user avatar
  • 161
-1 votes
1 answer
223 views

A data structure / algorithm to combine search tree and hash table?

I have a two dimensional data with one dimension is ordered and another one is categorical, for example, country and city_age: country age city Italy 2773 Rome Germany 784 Berlin USA 397 New York ...
Dims's user avatar
  • 157
1 vote
3 answers
486 views

What makes a data pipeline scalable? Best practices for scalable design?

I have been searching about this topic for a few days and have not yet found anything on books, courses or tutorials. What is a way to make data pipelines more scalable, that doesn't involve NoSql or ...
ThePorcius's user avatar
4 votes
1 answer
1k views

Text adventure game: is there a more elegant way to store data & control logic?

so for the past several months, I've been working on a personal project. It's a comically large, highly open, handcrafted text adventure game packed with inside jokes and fun little surprises for my ...
johnnymcmike's user avatar
2 votes
1 answer
323 views

Should a data class manipulate its input?

Background I'm a scientist and trying to incorporate better software development practices in my work. In my niche field there's a standard model everyone uses that accepts a whopping 56 arguments. I'...
coney1's user avatar
  • 87
-1 votes
1 answer
459 views

Best way to store and fetch image bytes?

I have a case in my startup where I need to fetch images in bytes as fast as possible. At the moment I'm storing the images in Azure Storage then I fetch them on the run and cache them into my ...
Faisal's user avatar
  • 107
0 votes
2 answers
86 views

Restructuring a “processing slip” like object used in many steps

I have worked on a library which processed data through multiple steps. It was written in R, a dynamic programming language where one could just add fields to existing “objects”, which were just ...
Martin Ueding's user avatar
4 votes
1 answer
955 views

What is the most suitable data structure for IPv4 addresses with intersecting ranges?

Mostly in all routers and operating systems the Longest Prefix Match algorithm is used for searching the trie of IPv4 addresses. Packet filters like Iptables don't need some special data structure for ...
red0ct's user avatar
  • 99
2 votes
2 answers
90 views

Do calculations based off of already-included fields belong in a data-structure?

Say I have the following data-structure describing a given widget sold by my company, which contains fields of purely atomic information (i.e. data that cannot be otherwise derived from other ...
Samuel Ludwig's user avatar

1
2 3 4 5
19