Skip to main content

Questions tagged [data-structures]

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

49 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4 votes
0 answers
110 views

IRLBot Paper DRUM Implementation - Why keep key, value and auxiliary buckets separate?

Repost from here as I think it may be more suited to this exchange. I'm trying to implement DRUM (Disk Repository with Update Management) as per the IRLBot paper (relevant pages start at 4) but as ...
Isaac's user avatar
  • 183
3 votes
0 answers
190 views

What is a good way to structure a timespan-oriented index?

I'm finishing off work on a complex rule-engine for Hotel Rates with real-time queries. There is a lot of conditions addressing intersections of periods for options, restrictions and policies. All of ...
Julian's user avatar
  • 264
3 votes
0 answers
141 views

Possible to find intersections between a line segment and a disjoint set in log2(n)?

Given a set S of disjoint 2D line segments, is there a way to pre-process S into a data structure that can check if a single arbitrary segment L intersects any segment in S in log2(n) time, as well as ...
Aeris130's user avatar
3 votes
0 answers
598 views

Optimal data structure for binary data/Java

I have several input formats mostly restricted to geotiff and some proprietary binary formats. I import them into my program and then need to export them into various other data formats (also binary) ...
user avatar
3 votes
1 answer
163 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 ...
Deniss Kozlovs's user avatar
3 votes
1 answer
229 views

Cache-conscious data structure that does not require hashing

I am looking for a cache conscious data structure that does not require hashing. This is to avoid HashDoS without needing to use cryptographic PRFs such as SipHash, which are slow (~1 cycle/byte) &...
Demi's user avatar
  • 826
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 ...
Jeff Putz's user avatar
  • 154
2 votes
0 answers
448 views

How to segregate data between user groups in Django?

django.contrib.auth has User and Group models. I'm using the User model for my users, and the Group model to manage their broad permissions (access to admin site, access logs, etc). I also have my ...
Escher's user avatar
  • 185
2 votes
0 answers
349 views

Most suitable data structure for in-memory string -> int conversion for variable length strings

My project involves validating and normalising email addresses in this format [userpart]@[domainpart].[tld] After syntactic validation of the address, [tld] is checked to exist, otherwise the ...
innvo's user avatar
  • 21
2 votes
1 answer
490 views

Data Structure for "Intuitive" Text Matching

I've noticed that text editors and such have a more-than-prefix/suffix-based pattern matching algorithm going on behind the scenes. And StackOverflow's tag matching algorithm does more than just ...
Lance's user avatar
  • 2,605
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
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
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 ...
brunouno's user avatar
  • 127
1 vote
0 answers
136 views

What is a good design for accumulating temporary data stemming from several processing runs?

I would like to compute cycle times for some manipulator movements. These movements consist of different phases. I have a class that models these phases and this is its constructor to give an idea: /**...
Benjamin Bihler's user avatar
1 vote
0 answers
333 views

How to use lock-free FIFOs in multi-threading?

Computer-science wisdom says that a lock-free FIFO (queue) is the right way to synchronize shared data between two threads in a lock-free manner. I know what a queue is and how the lock-free property ...
Ignorant's user avatar
  • 357
1 vote
0 answers
229 views

Best practice to handle input and output with several csv-like files

I am currently writing an application with the following structure: input: the equivalent of an excel workbook, i.e. a few tables with different headers and a few scalar values. They represent ...
Andreas's user avatar
  • 19
1 vote
0 answers
210 views

Data structure for fast bi-directional SHA-1 to SHA-3 mapping

What data structure would be best choice for fast and performant bidirectional SHA-1 to SHA-3 mapping? Or in other words fixed-length string to fixed-length string mapping? To be more precise: ...
Jakub Narębski's user avatar
1 vote
0 answers
97 views

Hierarchical data structure: pull requests + pull request reviews + pull request review comments

GitHub has: pull requests pull request reviews pull request review comments BitBucket has only: pull requests pull request comments So there are three kinds of objects. I write code ...
porton's user avatar
  • 761
1 vote
0 answers
54 views

Check if a point is deviating from a path made by a set of line segments

I'd like to know or have other ideas --other than my solution-- about how to check if a car on a given position (lat, lng) is getting away (let's say a distance D away) from the path where the car ...
Sergio Guillen Mantilla's user avatar
1 vote
0 answers
104 views

high-dimensional index structures

I'm looking for information on searching (filtering) high-dimensional data. I'm not interested in nearest-neighbour search or clustering, but rather filtering/sorting by subset of dimensions - like in ...
mabn's user avatar
  • 161
1 vote
0 answers
115 views

How to structure enum data to achieve the desired effect

I'm making a framework for building simple html websites for an embedded system and I want to make it bulletproof in a way that a user can't make mistakes in building the html document. As I've ...
CodeBreaker's user avatar
1 vote
0 answers
62 views

Pagination with multiple groupings

I have a data model that looks like this: Group 1 --Sub group1 ----item1 ----item2 ----item3 --Sub group2 ----item1 ----item2 ----item3 Group 2 --Sub group1 ----item1 ----item2 ----item3 --Sub ...
DavidB's user avatar
  • 107
1 vote
0 answers
122 views

Search algorithm on sequential data model

For sequential data models like LinkedList, search algorithms like linear-search and binary-search are well known. Are their any other search algorithms apart from these two, that work on sequential ...
overexchange's user avatar
  • 2,285
1 vote
0 answers
53 views

Compound container for storing output from a parser

Consider a hierarchical structure like this directory [ [item_0;item_1;...;item_n] [item_0;item_1;inner_directory[...];item_m] other_directory [...] ] ...
user877329's user avatar
1 vote
0 answers
277 views

Single write, multiple read of stateful objects

Scenario: One data input feed (call this Source) Multiple objects (call these Layer1) read this Source, and analyze the feed. This analysis is stateful. Layer1 objects have configuration parameters. ...
durron597's user avatar
  • 7,610
1 vote
1 answer
706 views

What design patterns exist for large dataset manipulation within MVC for a rich client data grid?

I want to feed an HTML5 data grid with large data sets that the client will want to manipulate in different ways, e.g. aggregation, grouping, pivoting. The data comes from different web services and ...
Adam's user avatar
  • 187
0 votes
1 answer
1k views

Designing online exam

I need to design an online exam server for an exam like GRE in which question difficulty increases if you answer correctly and decreases if you answer wrong. Questions are multiple choice questions ...
Praful Bagai'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
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
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
0 votes
0 answers
61 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 ...
Kyle's user avatar
  • 37
0 votes
0 answers
72 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 ...
minseong's user avatar
  • 460
0 votes
0 answers
126 views

Does v8 have nested stack frames?

In chapter 4 of the Zone JS primer the following is mentioned: So far, we have discussed how zones are created, forked and how they maintain their state across asynchronous operations. Zones are ...
p32094's user avatar
  • 187
0 votes
0 answers
87 views

Is it idiomatic to use protobufs as containers within a service?

I love gRPC, but I find every step of the protobuf process rather frustrating (particularly in Python). Even though they are structurally similar to data structures composed of lists and dicts, you ...
DeusXMachina's user avatar
0 votes
0 answers
169 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 ...
sollniss's user avatar
  • 109
0 votes
0 answers
75 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 ...
Edvinas's user avatar
0 votes
0 answers
169 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 ...
Jason's user avatar
  • 1
0 votes
0 answers
49 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 ...
user10869858's user avatar
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 ...
Ekko's user avatar
  • 17
0 votes
0 answers
71 views

Correct way-data structure for advertising peers in a p2p network

Underlying problem In a case of a peer-to-peer discovery protocol,suppose we need to advertise peers in a manner that the network graph will grow such that we avoid cases of both too dense areas (e.g ...
ichantz's user avatar
  • 368
0 votes
0 answers
132 views

Best datastructure to use

I am using Amazon's dynamodb nosql database and as a result I need to think of some ways to do certain operations to fit into their limits (e.g 4k item limit, can't combine small items into the same ...
user2924127's user avatar
0 votes
0 answers
608 views

scrabble solving with maximum score

I was asked a question You are given a list of characters, a score associated with each character and a dictionary of valid words ( say normal English dictionary ). you have to form a word out ...
dharakk's user avatar
0 votes
0 answers
470 views

How to model dynamic table schema in .Net code

I am preparing to do an upgrade of a fairly large program that is currently written entirely in MS Access, both GUI and data (code and data in separate files). One of the key features of the product ...
LeeG's user avatar
  • 111
-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 ...
Serenity's user avatar
  • 141
-1 votes
2 answers
158 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 ...
Falzao's user avatar
  • 1
-1 votes
1 answer
619 views

Structure nested data

I have an issue with structuring som data. The idea is to have some sort of menu card, where you can build your own menu. The different products are categorized into groups, and in some of the groups ...
Anders's user avatar
  • 103
-1 votes
2 answers
196 views

Creating instances of an ability when there are multiple different type of abilities

I'm creating an RPG game where a player has a set of skills, each of which he can level up to improve its effect. Here are two example skills: health: increase player's maximum health regeneration: ...
Markus Meskanen's user avatar
-3 votes
1 answer
158 views

Determining MPG over a range of time using Dictionary and Class Objects

A group of friends are tracking the miles per gallon for each of their cars. Each time one of them fills up their gas tank, they record the following in a file: His or her name, The type of car they ...
RaksMen's user avatar
-4 votes
1 answer
137 views

Is there any formula or trick to count how many times a statement inside a nested loop gets executed?

I am modifying a software which is for trash collection. While reading the code, I asked myself is there any formula or trick to quickly calculate the number of time the statement gets executed inside ...
AKdeBerg's user avatar