Questions tagged [data-structures]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
92 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 ...
-2
votes
0answers
20 views

Concept Check: Data Server Nodes, Fetch Nodes

I had this idea for a way to make it possible to run a MUCH MUCH smaller node but still mine on a chain. I don't know if there is anything useful in it, but decided I would post it here for feedback ...
-3
votes
1answer
92 views

Best way of organizing and storing this data in an explicit way? [closed]

I'm developing a free app to help people know how long to wait for their next bus in a specific itinerary of my country. I'm inclined to use Python and Kivy to deploy the app on multiple platforms. I ...
0
votes
1answer
49 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 ...
0
votes
0answers
37 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 ...
-1
votes
1answer
83 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 ...
1
vote
3answers
114 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 ...
0
votes
0answers
38 views

How to represent deeply nested data

I work on a project that has a lot of hard-to-grasp data shapes. I'm talking about lists nested as deep as 5 levels. Often I have to reorder the way that data is represented in these lists. For ...
4
votes
1answer
263 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 ...
2
votes
1answer
105 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'...
-1
votes
1answer
90 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 ...
0
votes
2answers
60 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 ...
3
votes
1answer
245 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 ...
2
votes
2answers
85 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 ...
1
vote
2answers
114 views

Can you create a hash table made of binary trees?

For instance, if you have a hash table with the array of buckets 26 nodes long, one for each letter of the alphabet. You use that to keep track of names. So when a name "Jed" is added to the ...
0
votes
0answers
32 views

How to best process unreliable conditional data on the frontend?

For the past couple of weeks, I was working on creating a simple visual display of some data as bullet points. I already have a solution for the title but I wanted to post this question, to hopefully ...
-1
votes
1answer
75 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 ...
2
votes
1answer
76 views

Implementing a persistent searchable "queue"

I'm receiving a lot of a data entries from different (IOT) devices. I need to temporarily and persistently store this data until it is polled by the matching clients, after which it will be deleted. ...
0
votes
2answers
148 views

About layered architecture and the persistence layer

I’m pretty sure I’ve made some wrong assumptions in my questions so bear that in mind. At some point, the methods inside objects that are part of the persistence layer will be called/accessed for say… ...
0
votes
4answers
130 views

Thinking about data as object vs table row [closed]

It often happens that we have a set of structured data. Let's say our data is about charitable organizations. I could turn it into a list/set of objects/structs: struct Charity { let name: String ...
-1
votes
3answers
222 views

Design pattern for creating and scheduling tests/exams

I have an Exam class that represents an examination/test: public class Exam { public int Id { get; set; } [Required] [StringLength(maximumLength: 30, MinimumLength = 1] public string ...
0
votes
1answer
149 views

How can I represent a graph for a visual programming language in JSON?

I am in the process of implementing a visual programming language similar to Blender's node editor or Unreal Engine Blueprints. It will be implemented as a SPA that will communicate with a JSON based ...
1
vote
2answers
234 views

Efficient set method in run length encoded C++ map

I have been designing a C++ class that maps an integer to an integer using a vector. Because there is a lot of repetitive data (for example 11115555666222), I am using a compression scheme where I am ...
0
votes
1answer
44 views

Best data structure for searching best color match? (4D space)

My current color distance formula is a modified version of Euclidian distance (eDist) because with eDist I was noticing weird issues where blue could be used instead of green in some situations when ...
0
votes
2answers
188 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 ...
0
votes
1answer
104 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 ...
2
votes
2answers
65 views

Make modifications to a database resource specific per company

Context I've been searching the internet to see if I could find any other information or posts about what I'm trying to achieve, but I had no luck. I don't know if there's a specific term or whatever ...
-1
votes
1answer
164 views

Should all structures be ADTs?

Is there any specific category an ADT must be in? I'm struggling to find out how best to represent objects in the program for example: As a record: struct Person { int age }; Or as an ADT: struct ...
0
votes
1answer
79 views

Custom datatype and their constructors - should you clone, or just copy?

Suppose we have the following C snippet, implementing a tree data structure: typedef struct node { char* data; struct node** children; unsigned int num_children; } node; Then we could ...
2
votes
1answer
319 views

Alternatives for index arrays

I work on a C++ project where I am not really happy with the data structures. The question isn't that specific to C++, I think that I would face a similar issue in say Java or Python. There are data ...
1
vote
1answer
137 views

How to separate public and private headers when internal data structures are private?

When developing a shared library in C, it is common to separate the "public" headers from the "private" headers. The public headers contain all the functions and types that are ...
1
vote
1answer
90 views

How to represent Spacial Time Series data in json clearly?

Currently, I have an application generating time series spacial data. The data is weather data with coordinates and a time of reading. I would like to receive chunks of the data in a time series way ...
4
votes
2answers
186 views

Arrays vs Maps for listing items that have a unique id

I've been finding that for a lot of code I've been writing recently, it naively might look like this: Array approach: const options = [ { id: 'red', label: 'Red', data: '#f00' ...
7
votes
2answers
609 views

some misunderstanding in concept of Huffman algorithm

What is difference between Average length of codes and Average length of codewords in Huffman Algorithm? is both the same meaning? I get stuck in some facts: I see a fact that marked as False: for a ...
0
votes
2answers
114 views

How can I associate algorithm-specific data to the objects it works with, efficiently yet cleanly?

I'm writing in C++, but this problem applies to most non-high-level languages, and possibly some high-level ones as well. I have a graph of heterogeneous nodes. The graph can be instantiated by ...
0
votes
0answers
35 views

Organizing Complicated Matrix Traversal?

The following are some examples that you may see in an intro to programming course: Print the elements of an nxn array... Spiraling in from the outside Spiraling out from the center Zig zagging from ...
6
votes
4answers
293 views

Is there an algorithm that performs better than O(n^2) for this unique pair tuple problem?

I'm trying to figure out if it's possible to have an algorithm that solves a certain problem in better than O(n^2) time. Specifically, I'm looking for an algorithm that, given two lists of two-tuples (...
0
votes
1answer
135 views

Does it make sense to have redundant DB fields to improve query performance, programming speed and code readability?

I am a bit torn about the database design for a solution. I have the following structure: (only the relevant fields are marked with #) +------------------+ | activities | |------------------| | ...
-3
votes
1answer
183 views

What data structure works best with File Explorer-type applications?

I'm working on a desktop application in C# that reads a directory and displays in a DataGridView the directory entries of the PDFs found in that directory, like a File Explorer that only shows PDFs. ...
0
votes
1answer
117 views

how to store the data for function f(time,length)

I have a function which has discrete time step ,discrete length from origin . These two give height of the function. For example at time 1.2sec , and length 5.5cm from origin height is 10cm. The step ...
1
vote
2answers
103 views

How should I design a database where each user can have ten lists with thousands of possible entries?

I am trying to design a database where each user can save up to ten lists of cards. Each list could theoretically have tens of thousands of items, but will likely only have hundreds. Should I create a ...
1
vote
1answer
169 views

What's an efficient way to serve hundreds of gigabytes of text records to search clients in C++?

I am building a three-tier architecture application that receives compressed (zlib) text records from a data store, decompresses the records into structs, and then serves the records to clients over ...
-2
votes
4answers
251 views

Is there a name for the data structure [object, list, primitive] e.g. JSON? [closed]

tl;dr - I've settled on the terminology Traversable for the container type which includes List and Dict but excludes str, and Atom for anything which is not traversable, e.g. cannot nest indefinitely. ...
1
vote
1answer
668 views

Python: Class vs NamedTuple vs Hybrid vs DataClass

So all four of these approaches to structure data on their surface work more or less the same to keep data well structured. Are there any reasons, be they hidden performance issues/enhancements, ...
0
votes
1answer
744 views

Efficient way to find Xor of pairs with given target X in a range 0 to K

I came across a problem: given an array (can be huge 10^8) and an integer, K, find the count of pairs in the array whose Xor equal to each value in the range 0 to K. eg: Arr = 1 2 3 K = 2 since K=...
10
votes
2answers
487 views

Data structure for multi key range queries

I need a data structure that gives the best performance for multi-key range lookups. I do not need to update/insert/delete. This will be immutable. The use case is in-memory filtering of values over ...
1
vote
1answer
142 views

How to exchange rectangular arrays via HTTP efficiently and without tightly coupling requesters to responders?

Suppose a user defines input arrays on a JavaScript frontend. These are sent to a Python backend via the REST API. The backend computes a result for every combination of each array's elements. It ...
0
votes
0answers
64 views

Time-indexed "array" of time spans

I have a list of objects that have durations, ProcedurePart Start: double Stop: double Instructions: string they occur sequentially after each other: stepOne stepTwo ...
-3
votes
1answer
167 views

Data structures or coding styles in C++ for avoiding long elseif chain when parsing?

Lately I have created some small parsers of data. My initial code structure // more cases here ... else if(!strcmp(X,"somekey")){ // Parse according to "somekey" behavior. } // ...
2
votes
2answers
145 views

API architecture design for fast reads of text file with 150m unique labels

Assume a text file with 150m unique records. Each record has two columns: (1) string and (2) integer. The string is a unique label, and the integer is the label's value. The only query will return the ...

1
2 3 4 5
18