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

learn more… | top users | synonyms

8
votes
1answer
377 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? ...
3
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?
0
votes
1answer
137 views

Converting data-structure in Perl [closed]

A function produces this hash of arrays: 'KEYNAME1' => ARRAY(0x1edeeb0) 0 'val11' 1 'val12' 2 'val13' 'KEYNAME2' => ARRAY(0x1efacb8) 0 'val21' 1 'val22' 2 'val23' ...
1
vote
2answers
402 views

Arrow => in Perl

What does the => mean in Perl? my $CreateArray = [ objectClass => [ "top", "person", "organizationalPerson", "inetOrgPerson" ], cn => "Jane User", uid => "0000001", sn => "User", mail ...
1
vote
1answer
244 views

hash with file instead of array

Is it possible to use hash function but with File instead of Array, and it's gonna be saving the record in a file position and then search will fseek to that position, but I'm not sure how to open a ...
5
votes
1answer
600 views

Nearest color algorithm using Hex Triplet

Following page list colors with names http://en.wikipedia.org/wiki/List_of_colors. For example #5D8AA8 Hex Triplet is "Air Force Blue". This information will be stored in a databse table (tbl_Color ...
3
votes
4answers
418 views

Appropriate data structure for deeply nested data?

I can't figure out what would be an appropriate data structure for my problem. I need to write a script that will count some events. Input is a list of events (thousands of them). Each event is an ...
2
votes
8answers
991 views

Strategy/algorithm to divide pot to chips

I want to split poker pot to chips. Example: Pot = $17.500. I have the endless piles of chips. I have the following types of chips: ChipsTypes = [$1, $5, $10, $25, $100, $500, $1.000, $5.000, ...
6
votes
1answer
4k views

Decision trees vs. Neural Networks

I'm implementing a machine learning structure to try and predict fraud on financial systems like banks, etc... This means that there is a lot of different data that can be used to train the model eg. ...
1
vote
2answers
110 views

Cataloging events, projects and tasks: Is SQL appropriate?

I have this idea for a database: it would hold everything I "need to remember", and allow future coding projects to access the information. These future projects include a day-planner and historical ...
1
vote
5answers
1k views

What Java data structure/design pattern best models this object, considering it would perform these methods?

Methods: 1. getDistance(CityA,CityB) // Returns distance between two cities 2. getCitiesInRadius(CityA,integer) // Returns cities within a given distance of another city 3. ...
5
votes
3answers
798 views

Writing a new programming language - when and how to bootstrap datastructures?

I'm in the process of writing my own programming language which, thus far, has been going great in terms of what I set out to accomplish. However, now, I'd like to bootstrap some pre-existing data ...
36
votes
4answers
5k views

Which algorithms/data structures should I “recognize” and know by name? [closed]

I'd like to consider myself a fairly experienced programmer. I've been programming for over 5 years now. My weak point though is terminology. I'm self-taught, so while I know how to program, I don't ...
7
votes
3answers
528 views

A deque based on binary trees

This is a simple immutable deque based on binary trees. What do you think about it? Does this kind of data structure, or possibly an improvement thereof, seem useful? How could I improve it, ...
8
votes
13answers
6k views

What are some good, simple examples for queues?

I'm teaching CS2 (Java and data structures), and am having some difficulty coming up with good examples to use when teaching queues. The two major applications I use them for are multithreaded message ...
21
votes
4answers
962 views

What is the definition of “Big Data”?

Is there one? All the definitions I can find describe the size, complexity / variety or velocity of the data. Wikipedia's definition is the only one I've found with an actual number Big data ...
2
votes
1answer
215 views

List structures in memory

Could anyone give an overview of how list structures which are composed of a head and a tail which references the rest of the list i.e linked list are represented in memory of the computer? Does the ...
7
votes
4answers
604 views

finding houses within a radius

During an interview I was asked given the following: A real estate application that lists all houses that are currently on the market (i.e., for sale) within a given distance (say for example the user ...
1
vote
1answer
317 views

Javascript: Safely upload a client data file

I'm (still) working on a template-based XML editing program. It's a GUI-based XML editor that only allows users to add certain tags and attributes based off the requirements. You can see the current ...
4
votes
1answer
576 views

Which data structure to represent a triangular undirected graph

I was wanting to create a graph similar to this in C++: The one I will implement will have more edges and vertices, but will use this triangle style. I was wanting to create something that I could ...
8
votes
4answers
324 views

Origin of structures and classes

What design and implementation issues did programmers have to solve when they decided first to use structures and classes? When did this happened and who were the pioneers behind these ideas? Note, ...
3
votes
1answer
208 views

Logic required to solve a problem relating to location of objects

I have raised a question on dba.stackexchange.com but as the heart of my question is in fact to do with logic I have raised a more general representation of my issue here. I think it is the right ...
7
votes
3answers
13k views

Abstract Data Type and Data Structure [duplicate]

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 ...
10
votes
2answers
1k views

What is the most space efficient way to implement a graph data structure?

I typically implement graphs as doubly linked lists but this is fairly space inefficient in my experience as I need k pointers/references for k neighbors so for an undirected graph I'd have ~2k ...
39
votes
8answers
3k views

How should I build the data structure for a dynamic, unlimited-size “maze”?

I'm not actually sure that "maze" is the correct term. Basically users start in a single Room that has 4 doors (N, S, E, and W). They can go in any direction, and each subsequent room is contains ...
1
vote
3answers
931 views

Programming language with pattern matching in trees

I'd like to prototype a computer algebra system. An equation would be represented by a tree and rules would be defined - similarly to mathematical axioms - by specifying a pattern (in the tree) and a ...
1
vote
4answers
649 views

Data structure for file search

I've asked this question before and I got a few answers/idea, but I'm not sure how to implement them. I'm building a telecom messaging solution. Currently, I'm using a database to save my ...
10
votes
2answers
1k views

When programmers talk about “data structures”, what are they referring to?

When programmers talk about "data structures", are they only talking about abstract data types like lists, trees, hashes, graphs, etc.? Or does that term include any structure that holds data, such ...
9
votes
4answers
2k views

Are trees organised by a “firstchild, nextsibling” structure? If not, why not?

Usually, tree data structures are organised in a way that each node contains pointers to all its children. +-----------------------------------------+ | root ...
6
votes
4answers
394 views

Is there a way to track data structure dependencies from the database, through the tiers, all the way out to a web page?

When we design applications, we generally end up with the same tiered sets of data structures: A persistent data structure that is described using DDL and implemented as RDBMS tables and columns. A ...
6
votes
2answers
685 views

What is the Bible of Hashing?

Is there a Cormen-like reference on Hashes and Hashing? This particular structure has seen little attention in my CS education for some reason but I'd like to learn more as they seem to be everywhere. ...
6
votes
4answers
2k views

Where would I typically use a Deque in production software?

I'm fairly familiar with where to use Stacks, Queues, and Trees in software applications but I've never used a Deque (Double Ended Queue) before. Where would I typically encounter them in the wild? ...
7
votes
8answers
10k views

What is the difference between an Array and a Stack?

According to Wikipedia, a stack: is a last in, first out (LIFO) abstract data type and linear data structure. While an array: is a data structure consisting of a collection of elements ...
17
votes
2answers
649 views

What is an Aguri tree?

Going through some old Hacker News items, I came across a post from a user that said Aguri trees, which marry a bounded-size radix trie (like you'd use in a software routing table) to an LRU list, ...
15
votes
2answers
670 views

What is the canonical reference on probabilistic data structures?

I've heard of probabilistic data structures like Skip Lists and Bloom Filters being immensely useful and I'd like to learn more about them in general. Is there a canonical reference on the subject on ...
8
votes
5answers
4k views

Real world usage of DelayQueue

What would be a real world usage of DelayQueue, what common problem it was designed to solve?
2
votes
1answer
877 views

Keeping binary search tree balanced

I am educating myself on algorithms and data structures. For that, I am doing a simple program that would read lines like this: bdhj 168.24 dahf 42.88 dhfa 128.92 First column represents an account ...
2
votes
9answers
524 views

Standardized Data Structure Interface

I want to work with a variety of data structures (arrays, singly/doubly linked lists, sorted structures, etc.) on a plug-and-play basis. For example, I want to be able to easily swap in and out the ...
-3
votes
1answer
560 views

Writing-Reading a hashtable to a text file

I'm implementing a hashtable structure for a dictionary. Dictionary is in a text file. There are 2 words on each line. I'm generating the hashtable by using the first word as a key. I'm holding the ...
2
votes
2answers
389 views

How would you transfer data between your data structures and databases?

I'm learning programming in school and I have this question that's bugging me about data structures and transferring the information stored inside them to databases. We're doing just small systems - ...
15
votes
6answers
2k views

Is it a good practice to use smaller data types for variables to save memory?

When I learned the C++ language for the first time I learned that besides int, float etc, smaller or bigger versions of these data types existed within the language. For example I could call a ...
2
votes
4answers
782 views

Is it possible to efficiently store all possible phone numbers in memory?

Given the standard North American phone number format: (Area Code) Exchange - Subscriber, the set of possible numbers is about 6 billion. However, efficiently breaking down the nodes into the sections ...
1
vote
2answers
1k views

Equivalent of #map in ruby in golang

I'm playing with Go and run into something I'm unable to find in Google, although there is certainly something that exists: I'm using the following struct: type Syntax struct { name string ...
0
votes
7answers
3k views

Why would you use data structures (ie Binary Trees, Linked Lists) in your jobs/side projects? [closed]

It seems to me that, for everyday use, more primitive data structures like arrays get the job done just as well as a binary tree would. My question is how common is to use these structures when ...
0
votes
1answer
174 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 ...
2
votes
5answers
3k views

An XML file or Database?

I am re-writing a section of my site and am trying to decide how much of a rewrite this will be. At the moment I have a web service feed that generates an xml once per day. I then use this xml file on ...
47
votes
8answers
6k views

How to represent a Rubik's Cube in a data structure

If I am attempting to simulate a Rubik's Cube, how would you create a data structure to store the cube's state in memory, with X number of tiles per side? Things to consider: the cube can be of any ...
1
vote
4answers
256 views

Is it better to use a Database or a data structure for network stack?

I've built a multi threaded messaging application in C and I'm currently using a MySQL Memory table to save the session ID, but I'm not sure whether this was a good decision or not. It works like ...