Questions regarding efficient storing and representing data within a software application.

learn more… | top users | synonyms

7
votes
2answers
2k views

Using a stream manipulator (endl) or a newline escape character (\n)?

I don't have a specific context in which I'm asking the question, but while I was reading a beginner book on C++ I noticed the use of both an endl stream manipulator and a newline escape character ...
0
votes
2answers
507 views

Algorithms for data structures in distributed system

The hash table data structure can be easily spread across multiple machines with a simple algorithm to distribute the keys: machine_to_query = item_key % machine_count When you want to read and ...
5
votes
2answers
897 views

How do scalable bloom filters work?

I was reading up on scalable bloom filters and could not understand how each time a constituent bloom filters fills up, a new bloom filter with larger size is added. The elements that contributed to ...
2
votes
2answers
6k views

How to increase the efficiency of an Immutable Queue in java?

I have been developing an Immutable queue in java, but the version I have developed is supposedly slow and I have been suggested to create a faster version of the same and I have no idea as to how to ...
2
votes
2answers
821 views

Thoughts on a custom data structure for a node/chain implementation

I am designing a simple GUI that will allow a user to create a GPX route by clicking repeatedly on a map panel. I am faced with a design dilemma for how to represent the nodes and route. This ...
4
votes
2answers
921 views

Creating huge decision tree

I'm to write an event correlator. A fundamental part of the system will be a decision tree that recognizes the origin of the fault basing on recorded states and log files. Often many accidents will ...
3
votes
6answers
510 views

Should a database table(s) structure match its intended data structure(s) in the logic?

This question branches out of this question, What are the differences between algorithms using data structures and algorithms using databases?. The General Question Should a database table(s) ...
6
votes
4answers
418 views

Representing a rule in a ruleset

How to represent rules for a rule engine as objects? A rule would be if (booleanExpression(input)) then a chain of generic actions" else next rule ...where the generic actions might be e.g. ...
7
votes
4answers
2k views

What are the differences between algorithms using data structures and algorithms using databases?

The General Question What are the differences between algorithms using data structures and algorithms using databases? Some Context This is a question that has been bugging me for some time, and I ...
1
vote
3answers
831 views

What data structure could a word processor use to map the user's caret position/text selection to its internal representation of the document?

Word processors (e.g. Microsoft Word) display documents to the user as styled text. The user can select a part of this text and apply styles to it, and edit the text. The word processor must (I ...
3
votes
1answer
119 views

Representing domain objects

This is related to my recent question regarding naming awkward domain objects. A number of answers indicated I was using the wrong representation for the domain objects. To summarize, I chose to use ...
-1
votes
1answer
719 views

Simple dependency tree diagram generator [closed]

I have a need to produce a simple dependency tree diagram. The input data would be in the following simple format: ITEM_NAME DEPENDENCY ---------------------------- ITEM_101 ITEM_75 ITEM_102 ...
3
votes
2answers
3k views

How, when, and why do developers use custom data structures in python?

Python's lack of pointers makes data-structure construction intuitively more challenging, and has so much built in functionality that, as an amateur, I can't see when, why, or how you would create ...
20
votes
3answers
771 views

How do I express subtle relationships in my data?

"A" is related to "B" and "C". How do I show that "B" and "C" might, by this context, be related as well? Example: Here are a few headlines about a recent Broadway play: David Mamet's Glengarry ...
4
votes
3answers
724 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. ...
15
votes
1answer
11k views

Sets Data Structure in Golang

I really like google golang but could some one explain what the rationale is for the implementors having left out a basic data structure such as sets from the standard library?
-3
votes
1answer
653 views

map data structure in pacman [closed]

I am trying to make a pacman game in c#. I have done some basic work and have previously replicated games like copter-it and minesweeper. I am confused about how to implement the map in pacman. Which ...
5
votes
3answers
355 views

Generating Deep Arrays: Shallow to Deep, Deep to Shallow or Bad idea?

I'm working on an array structure that will be used as the data source for a report template in a web app. The data comes from relatively complex SQL queries that return one or many rows as one ...
4
votes
2answers
902 views

Which design better when use foreign key instead of a string to store a list of id

I'm building online examination system. I have designed to table, Question and GeneralExam. The table GeneralExam contains info about the exam like name, description, duration,... Now I would like to ...
4
votes
2answers
447 views

Fast set indexing data structure for superset retrieval

I am given a set of sets: {{a,b}, {a,b,c}, {a,c}, {a,c,f}} I would like to have a data structure to index those sets such that the following "lookup" is executed fast: find all supersets of a given ...
5
votes
2answers
1k views

Data structure for pattern matching

Let's say you have an input file with many entries like these: date, ticker, open, high, low, close, <and some other values> And you want to execute a pattern matching routine on the ...
0
votes
3answers
192 views

I need some help creating a non-binary tree (or some other data structure that will better solve my problem)

I have about ten lists of numbers and some strings. Each list has about <= 30K lines. Each line on a list has a distinct number. I need to build an efficient way of finding all the lines in each ...
4
votes
2answers
836 views

Patterns for a tree of persistent data with multiple storage options?

I have a real-world problem which I'll try to abstract into an illustrative example. So imagine I have data objects in a tree, where parent objects can access children, and children can access ...
31
votes
7answers
8k views

When to use DAG (Directed Acyclic Graph) in programming?

I recently found a framework named ecto. In this framework, a basic component named "plasm", which is the ecto Directed Acyclic Graph.In ecto, plasm can be operated by ecto scheduler. I am ...
6
votes
1answer
288 views

How to design data structures for sharding?

When designing data structures for an application, what are some best practices to make sure it can be sharded? In particular, which of the following is better: Creating relationships in databases ...
6
votes
1answer
2k views

What is the usage of Splay Trees in the real world?

I decided to learn about balanced search trees, so I picked 2-3-4 and splay trees. What are the examples of splay trees usage in the real world? In this Cornell: ...
3
votes
2answers
456 views

I have data that sends in “bursts” of 100 records with a significant delay. How do I structure my classes for multithreading?

My datasource sends information in 100 batches of 100 records with a delay of 1 to 3 seconds between batches. I would like to start processing data as soon as it's received, but I'm not sure how to ...
3
votes
1answer
951 views

How should I architect my Model and Data Access layer objects in my website?

I've been tasked with designing Data layer for a website at work, and I am very interested in architecture of code for the best flexibility, maintainability and readability. I am generally acutely ...
1
vote
2answers
620 views

Count function on tree structure (non-binary)

I am implementing a tree Data structure in c# based (largely on Dan Vanderboom's Generic implementation). I am now considering approach on handling a Count property which Dan does not implement. The ...
1
vote
6answers
5k views

Serializing Data Structures in C [closed]

I've recently read three separate books on algorithms and data structures, tcp/ip socket programming, and programming with memory. The book about memory briefly discussed the topic of serializing data ...
5
votes
2answers
258 views

Data structures for storing finger/stylus movements in drawing application?

I have a general question about creating a drawing application, the language could be C++ or ObjectiveC with OpenGL. I would like to hear what are the best methods and practices for storing strokes ...
2
votes
1answer
265 views

2D grid with multiple types of objects

This is my first post here in programmers.stackexchange (I'm a regular on SO). I hope this isn't too general. I'm trying a simple project to learn Java from something I've seen done in the past. ...
2
votes
1answer
159 views

Separating validation from persistence in models?

Models in an MVC application gets kind of hard to test when validation of data and persistence of data is baked together in the model. I would like to test those separately to prevent doing ...
3
votes
3answers
476 views

Internal Mutation of Persistent Data Structures

To clarify, when I mean use the terms persistent and immutable on a data structure, I mean that: The state of the data structure remains unchanged for its lifetime. It always holds the same data, ...
6
votes
1answer
161 views

Unit testing a text index

Consider a text index such as a suffix tree or a suffix array supporting Count queries (number of occurrences of a pattern) and Locate queries (the positions of all the occurrences of a pattern) over ...
5
votes
2answers
790 views

Efficient Data Structure for holding a graph

Problem Link - http://opc.iarcs.org.in/index.php/problems/NUMTRIPLE In my opinion, the problem can be solved by a data structure, that shows how each number is connected to another, and via recursion ...
3
votes
1answer
453 views

Amazon Kindle - Whispersync implementation?

For those who are not aware of Kindle's whispersync, here is how it works (from amazon.com): "...Whispersync synchronizes the bookmarks and furthest page read among devices registered to the same ...
0
votes
1answer
54 views

Create association between informations

I deployed a project some days ago that allow to extract some medical articles using the results of a questionnaire completed by a user. For instance, if I reply on questionnaire I'm affected by ...
1
vote
2answers
922 views

Does the Head(start) pointer of Doubly Linked list points previously to the tail(last) node

I have one question in my mind that in case of circular doubly linked list the head pointer of the doubly linked list also logically point to the next pointer of the tail node of the linked list and ...
2
votes
1answer
5k views

Most efficient Implementation a Tree in C++

I need to write a tree where each element may have any number of child elements, and because of this each branch of the tree may have any length. The tree is only going to receive elements at first ...
1
vote
2answers
7k views

Generic Adjacency List Graph implementation

I am trying to come up with a decent Adjacency List graph implementation so I can start tooling around with all kinds of graph problems and algorithms like traveling salesman and other problems... ...
3
votes
3answers
487 views

Data structure: sort and search effectively

I need to have a data structure with say 4 keys . I can sort on any of these keys. What data structure can I opt for? Sorting time should be very little. I thought of a tree, but it will be only help ...
6
votes
3answers
2k views

Data classes: getters and setters or different method design

I've been trying to design an interface for a data class I'm writing. This class stores styles for characters, for example whether the character is bold, italic or underlined. But also the font-size ...
11
votes
5answers
5k views

Configuration data: single-row table vs. name-value-pair table

Let's say you write an application that can be configured by the user. For storing this "configuration data" into a database, two patterns are commonly used. The single-row table CompanyName | ...
0
votes
5answers
1k views

Learning basic algorithms - better C or C++? [closed]

I'm studying fundamental algorithms (quicksort, mergesort, binary trees, etc..) and I'm going to re-code every algorithm by scratch to learn how they work. Should I code them in C or C++? I think with ...
1
vote
3answers
267 views

I want to create an open data format… but I don't really know what that is

I have found a need for a standardization for storage and recording of data relating to diabetes information (I don't think there's any, but I may have missed it). To that end I made this github ...
8
votes
1answer
407 views

Is there any better approach to shortest path finding within a (vehicular) traffic network?

Dear fellow programmers, We're developing software which simulates vehicular traffic. Part of the process called "assignment" is concerned with assigning vehicles to their routes and has to use some ...
9
votes
4answers
2k views

Analyzing Memory Usage: Java vs C++ Negligible?

How does the memory usage of an integer object written in Java compare\contrast with the memory usage of a integer object written in C++? Is the difference negligible? No difference? A big difference? ...
4
votes
2answers
2k views

Amortized Analysis? (Worst-case Performance Guarantees)

What is Amortized Analysis? And how can it help me achieve worst-case performance guarantees in my programs? I was reading that the following techniques can help the programmer achieve Worst-case ...
6
votes
5answers
2k views

What do you call classes without methods?

What do you call classes without methods? For example, class A { public string something; public int a; } Above is a class without any methods. Does this type of class have a special name?