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 ...
0 votes
3 answers
1k views

Whats the difference between a Ledger and a list of transactions?

re: algorithm and data structure concepts When accountants talk about Ledgers they have something very specific in mind. As a programmer I'm very used to thinking about tables of information, but ...
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. ...
0 votes
1 answer
213 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 ...
-2 votes
2 answers
2k views

Can every solvable problem be solved using any algorithm design?

I recently started reading theory behind algorithms. I then started thinking about "what if we abstract problems and algorithms, so you would be able to implement a generic system that can solve most ...
2 votes
2 answers
280 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 ...
15 votes
5 answers
7k 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 ...
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 ...
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. ...
1 vote
1 answer
245 views

Data structures - prioritizing records based on pending actions

I need to add a priority column to an orders database to sort them, which will vary depending on what has already been done (actions taken). The other catch is: there are two different roles that will ...
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 = &...
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 ...
1 vote
6 answers
1k 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 ...
6 votes
5 answers
3k views

Is my understanding of abstract data-types correct (ADTs)?

After reading lots of pages on various sites, I came to the conclusion that abstract data-type (ADT) helps to separate the use of a data-structure from its implementation. We can easily map the data ...
15 votes
5 answers
10k views

Understanding Abstract Data Types (ADTs) [duplicate]

Just browsing through Code Complete last night and I came across the explanation of abstract data types. I must have read it 5 times, and the Wikipedia article doesn't help much either. So what I'm ...
49 votes
4 answers
125k views

Abstract Data Type and Data Structure

It's quite difficult for me to understand these terms. I searched on google and read a little on Wikipedia but I'm still not sure. I've determined so far that: Abstract Data Type is a definition of ...
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 ...
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: ...
-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 ...
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, ...
-1 votes
2 answers
471 views

search message in a conversation like messenger

I want to implement a search feature in my chat application like a messenger, skype, whatsapp has done. What they have done is when we search a word then it would not only show the message with that ...
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 ...
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 ...
0 votes
3 answers
624 views

Which is the best data structure to use when you want to randomly pick elements & use them, but also delete them after use

I have 1000 lines in a text file. I want to read them into some data structure[DS]. After reading them, I will be randomly picking 50 lines from the DS (using a Random Number Generator). Next time 50 ...
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 ...
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. ...
4 votes
1 answer
671 views

Potential legal issues with lock-free / wait-free structures / algorithms

While researching the subject matter - lock-free and wait-free data structures - I'm seeing a worrying amount of mention of patents with this area. I've hobby-researched compression algorithms years ...
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 ...
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 ...
-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 ...
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 ...
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 ...
-4 votes
7 answers
906 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 ...
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 ...
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/...
29 votes
7 answers
12k views

Why are data classes considered a code smell?

This article claims that a data class is a "code smell". The reason: It's a normal thing when a newly created class contains only a few public fields (and maybe even a handful of getters/setters)....
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%...
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), }...
-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 ...
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 ...
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 ...
14 votes
5 answers
7k views

Is there a specific purpose for heterogeneous lists?

Coming from a C# and Java background, I'm used to my lists being homogeneous, and that makes sense to me. When I started picking up Lisp, I noticed that the lists can be heterogeneous. When I started ...
4 votes
3 answers
8k views

Is it conceivable to have millions of lists of data in memory in Python?

I have over the last 30 days been developing a Python application that utilizes a MySQL database of information (specifically about Norwegian addresses) to perform address validation and correction. ...
87 votes
7 answers
65k views

EAV - is it really bad in all scenarios?

I'm thinking to use an entity-attribute-value (EAV) model for some of the stuff in one of the projects, but all questions about it in Stack Overflow end up to answers calling EAV an anti-pattern. But ...
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 ...
-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 ...
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 "...
-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 ...
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 ...
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 ...

1
2 3 4 5
19