Questions tagged [data-structures]

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

Filter by
Sorted by
Tagged with
2
votes
0answers
217 views

Generate all combinations from two data-sets [closed]

I have a large number of expressions which I am trying to solve. List 1 contains formulas like A = B + C. List 2 contains additional equations for those variables, like C = D*3, C = B/2, B = D*50, ...
2
votes
1answer
3k views

Implementing tags in object

In my app, I'm implementing a questionnaire system and I'd like to implement tags for questions -- very similar to tags in questions here or Stack Overflow. I wanted to get some advices on how to ...
2
votes
2answers
701 views

Is there any point in a digraph implementation?

The Foreword Hi! I'm just your average, fairly beginner, computer science student doing personal programming side projects, and who is probably out of his depth and has no clue what he's doing. So, I ...
1
vote
2answers
68 views

Import configuration and relational data

Suppose that a user has multiple items. Each item would have complex configuration - multiple tables with relationships. Each configuration table would have an id and a item_id which is a FK to items ...
4
votes
4answers
392 views

Is it better to generate a large list during the constructor or when it's accessed?

I've got a class member function that generates a large list and puts it into a private member variable so it can be accessed through a getter. The generation of this list is a rather intensive ...
1
vote
2answers
359 views

How should I implement container customization in a library?

I am currently working on adding more customization to an entity component system library, although the problem is a little more general than that. In essence, I currently have hard coded containers ...
4
votes
2answers
5k views

Store and Tag Millions of Images

I am building an application where I need to store millions of images and later tag them. The tags attributed to the images could change over time as the tagging system evolves. Images will then be ...
3
votes
2answers
195 views

How to model relational data that can be organized in multiple ways? [closed]

I’m working in a project that is building a system to manage data (10-20 million records) collected by a research organization. One of the challenges is that even though the data is superficially ...
57
votes
6answers
33k views

Why do many functions that return structures in C, actually return pointers to structures?

What is the advantage of returning a pointer to a structure as opposed to returning the whole structure in the return statement of the function? I am talking about functions like fopen and other low ...
0
votes
1answer
136 views

Can a database wrapper be implemented in Scala using Traits? Is there a better way?

I've decided to implement a database wrapper to provide data operations of a web service using postgresql dbms. Models in my database are somelike complex and frameworks like slick do provide more ...
15
votes
4answers
23k views

Is storing a list of strings in single database field a bad idea? Why?

Recently, I started to work on some legacy system. People that developed it, came to an idea to store list of strings in single field of database table. Lets say that it is an identifier for object ...
-3
votes
2answers
526 views

Which data-structure or programming technique to use when?

While studying for Data structures and Algorithms, I noticed that there is a pattern/group in which every question falls into. Example - Given this, do/find that - Category 1. use these methods/...
-1
votes
1answer
527 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 ...
0
votes
1answer
127 views

Multi-user data driven desktop application for RDPs on a network

I'm currently making an desktop application for the company I work for. The goal of the application is to control the flow of a manufacturing process and it will be used by 5-7 user (working of remote ...
-3
votes
3answers
468 views

Priority Queue and Set in Java or general

why do we need priority queue when a set always keeps its object sorted, I think we can always remove the first/last element of a set and it would work as priority queue because priority queue offers ...
5
votes
2answers
12k views

Is there a tree data structure with multiple root nodes?

I've read this post Name of data structure that's tree-like with multiple root nodes. What I'm asking for is not a forest. I would give you a simple example that easily depicts my case. You ...
-1
votes
1answer
202 views

How do different file types generally store data?

I am working on a project, for which I want to create my own file format to store large amounts of data. I am trying to decide how that file format should be built to be as efficient as possible. The ...
1
vote
1answer
88 views

Sorting method for music avoiding title and artist repetition

I'm looking for pseudocode suggestions for sorting my mp3 files in a way that avoids title and artist repetition. I listen to crooners - Frank Sinatra, Tony Bennett, Ella Fitzgerald etc. singing old ...
-2
votes
1answer
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 ...
-1
votes
2answers
384 views

How should i pass a generic filter for database queries?

I have a interface DataStore, which provides access to a generic data store, e.g. a local database, webserver, etc. I want to provide a way to filter results directly in the query. How should i pass ...
2
votes
1answer
2k views

What’s the most efficient way to store this data? (csv flat files, same row headings, tree structure)

My data: Size - 15+ Terabytes of text. Data: Maximum of 1300 rows (always same row headers) , Maximum of 6 columns The column headers will be different but the value are all percent values that will ...
4
votes
1answer
1k views

In the MVP architecture, how should the Model layer get its data?

I am new to high-level (Android / Java) application development and I learned of the MVP (Model, View, Presenter) architecture. But it's not clear what the role and design of the Model layer is ...
25
votes
2answers
51k views

How to represent a set in JSON?

JSON supports the following data structures (Java equivalents): Scalar, Array/List, and Map. A Set is not supported out-of-the-box in JSON. I thought about several ways to represent a set in JSON: [...
-1
votes
2answers
170 views

Identifying similar customer data [duplicate]

I have a large database of customers. There's a need to identify customers who have two or more customer IDs. This comes mostly from people at the front-desk creating new customers instead of ...
0
votes
1answer
130 views

Apart from immutability, does blockchain offer any other advantages?

I am trying to understand the broader implications of blockchain apart from the main advantage of immutability. Are there any? It seems like the distributed nature of the ledger can be an asset when ...
1
vote
1answer
723 views

How to show lists/products based on user profile/preference

I'm building a web service where I need to show different products/lists to different users based on their profiles/preferences. For example: John, 24/M, single: Show list A and D; Kyle, 48/M, ...
-4
votes
1answer
232 views

In terms of performance and memory usage, which is better in storing objects: Dictionary or List?

I want to know if it's faster and more efficient to store and access objects in a nested dictionary Dictionary<string, Dictionary<string, int>> VS List<Object>. Though adding objects ...
1
vote
1answer
1k views

What is the advantage of POSIX queue or just normal data structure queue?

I'm programming with the embedded device running Linux, where memory is less, I just have 64MB flash only. I planned to use queues for the thread communication. In which I came across with using ...
0
votes
1answer
89 views

Grouping and changing data structure - Mutable tasks with database data

Writing some services on a system I'm working on has raised some questions as to how to provide the data formatted for the client (views or mobile app). Basically, my doubt is born whenever I need to ...
1
vote
1answer
122 views

What kind of pointer bug is this specifically?

UncommentatedPannen's (pannenkoek2012) newest video describes a glitch in the Nintendo 64 game Super Mario 64, which allows an object to push Mario out of bounds, which isn't normally possible, by ...
3
votes
2answers
2k views

Design patterns for processing/manipulating data

Sometimes when I write a class or piece of code that has to deal with parsing or processing of data, I have to ask myself, if there might be a better solution to the problem. Example 1: In a recent ...
1
vote
3answers
907 views

Which data structure is best for an auto complete drop down that learns?

I made an auto complete text box for an application I'm working on. The text box basically has an associated list that it searches each time you enter something in the box. If you enter something ...
56
votes
4answers
14k views

Why is using MySQL for a dictionary website a bad idea?

I'm planning to design and set up a database to store dictionary entries (usually single words) and their meaning in another language. So, for example, the table Glossary must have entry and ...
6
votes
3answers
884 views

Large doubly-linked-list (or other) storage on disk for queue system; options for how to store

I'm looking at building a message queuing library in Go, which will be used as part of a larger application. A doubly-linked-list seems like a sensible approach for an in-memory data structure, but ...
2
votes
1answer
403 views

Monte Carlo Tree Search in Game AI

I am very confused in implementing MCTS for a connect 5 game. According to Wikipedia: Selection: start from root R and select successive child nodes down to a leaf node L. Lets say it's the AI's ...
0
votes
3answers
4k views

Mostly sorted arrays: Insertion sort vs insert at sorted position

I'm trying to figure out the most efficient way of maintaining a sorted ArrayList. I'm inserting items into the array one at a time. I'm deciding between two methods: inserting the item at the sorted ...
0
votes
1answer
434 views

Javascript queue-like key-pair sorted collection

I'm looking for a collection that would suit my scenario: I will be inserting key-value pairs (both integers) of ID and timestamp. The ID must be unique. At some interval I will be checking that ...
1
vote
2answers
2k views

What pattern for implementing multiple interfaces on the same type?

Description of the environment: I am implementing a (hobbyist) modern engine for (an old) PlayStation 1 video game Graphical data is represented as packets where it can represent either a polygon or ...
0
votes
2answers
1k views

Tips and tricks in implementing XML or XML schema

First is I'm starting to build a standard XML format/structure for our users. The objectives are: XML that can be used for multiple organisations XML that can be used to map external system data to ...
0
votes
1answer
2k views

What is a recommended way to store database information?

I am using a Java to connect to MySQL database. I want to iterate through this data and store it into a data structure. This data structure will be JSON.parse() and converted from server side to ...
5
votes
3answers
11k views

What is the space complexity for inserting a list of words into a Trie data structure?

There is a quite a bit of information about the time complexity of inserting words into a Trie data structure, but not a whole lot about the space complexity. I believe the space complexity is O(n**m)...
2
votes
1answer
199 views

Should I add complexity to my POCO data objects to reflect their relationships, or wrap them in a more complex class?

I've got a set of immutable POCO objects that reflect database content. These have a one-many relationship: Property has one PropertyType, which has many PropertyTypeMetadatas. Because Property has ...
2
votes
3answers
2k views

Why did the C++ std library have a binary search tree well before a hashmap which is in many ways simpler

Looking at the two data structures and algorithms to handle them, a hashmap is not really any more complicated than a binary search tree and possibly less complicated. And the hashmap has the ...
-1
votes
1answer
224 views

Modelling research paper data in JSON

I need to design an UI to edit a research paper, I don't have enough knowledge about the research domain but still I tried to do my best and thought to design a normalized schema. I am describing the ...
1
vote
1answer
71 views

How to implement arranging objects into hierarchical structure in a relational database

I'm developing an application where users can create certain business objects (for simplicity let's just call them 'objects') that are stored in table in a relational database (the column names are ...
0
votes
1answer
63 views

Should you tag/flag an object or move it to a different collection?

When you need to classify an object; what are the design implications for using a collection vs a member field (say a Boolean flag). So say I have a Client object, Client is either 'active' or '...
30
votes
3answers
18k views

What difference is there between using a struct and a std::pair?

I am a C++ programmer with limited experience. Supposing I want to use an STL map to store and manipulate some data, I would like to know if there is any meaningful difference (also in performance) ...
0
votes
1answer
437 views

How to represent message with sub messages?

I am trying to implement a message that contains sub messages. The format would look something like the following. Message: Field 1, field 2, ..., sub type, buffer Depending on the sub type there ...
2
votes
1answer
208 views

Optimal format for storing key/value data optimized for quick key lookup

For a completely fun project, I want to write a Markov chain chat bot. The algorithm used is quite simple - break down incoming sentences into tokens, storing what words tend to come after each token ...
3
votes
0answers
162 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 ...

1
3 4
5
6 7
18