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

learn more… | top users | synonyms

86
votes
24answers
39k views

Why are data structures so important in interviews?

I am a newbie into the corporate world recently graduated in computers. I am a java/groovy developer. I am a quick learner and I can learn new frameworks, APIs or even programming languages within ...
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 ...
39
votes
6answers
3k views

How necessary is it to follow defensive programming practices for code that will never be made publicly available?

I'm writing a Java implementation of a card game, so I created a special type of Collection I'm calling a Zone. All modification methods of Java's Collection are unsupported, but there's a method in ...
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 ...
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 ...
30
votes
7answers
6k 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 ...
24
votes
12answers
7k views

Do I need to understand algorithms and data structures to be called a programmer? [closed]

It has been six years since I have been coding. Coding into all kinds of things like ActionScript, JavaScript, Java, PHP, Ajax, XML HTML, ASP, etc. I have used arrays, maps, linked lists, sets, etc ...
22
votes
2answers
739 views

Is there a data structure for this type of list/map?

Perhaps there's a name for what I want, but I'm not aware of it. I need something similar to a LinkedHashMap in Java, but where it returns the 'previous' value if there's no value at the specified ...
21
votes
7answers
3k views

Should I keep investing into data structures and algorithms?

These days, I'm investing heavily in data structures and algorithms and trying to solve some programming puzzles. I'm trying to code and solve with Java and Clojure. Am I wasting my time? should I ...
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 ...
20
votes
3answers
759 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 ...
20
votes
4answers
3k views

Which algorithms and data structures should a developer absolutely know?

I want to be a successful enterprise Java developer. With what algorithms and data structures should I be well versed? What books would you recommend to me? To be a successful Java developer, do I ...
17
votes
8answers
3k views

Is having trouble with data structures common for beginners?

I'm taking my second course on Java. We are getting into data structures. I have done an assignment on a linked list, and now a stack. I had a hard time with the linked list. The stack gave me a ...
17
votes
6answers
865 views

How did we get saddled with the (hierarchical) filesystem as the basic data structure?

I'm self-taught and I don't have a CS degree. The more I've been learning about data structure, the more I wonder, in this day and age, how are we still saddled with the filesystem, with directories ...
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, ...
16
votes
2answers
1k views

What's the difference in content between Chris Okasaki's 1996 thesis and 1999 book, Purely Functional Data Structures?

I want to read Purely Functional Data Structures. I've easily found the thesis (which is freely available as a PDF), but see that there's a book available also. So I'd like to know what the ...
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 ...
15
votes
4answers
7k views

Difference between hash and dictionary

What is the difference between Hash and Dictionary. Coming from a scripting background, I feel that they are similar , but wanted to find out the exact differences, Googling did not help me much.
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 ...
14
votes
3answers
1k views

How do purely functional programming languages deal with fast changing data?

What data structures can you use so you can get O(1) removal and replacement? Or how can you avoid situations when you need said structures?
13
votes
4answers
1k views

What did Bill Gosper mean by saying a data structure is just a stupid programming language?

There's a quotation by Ralph William Gosper, Jr that says: A data structure is just a stupid programming language. What did he mean by this? Alas, all I can find in Google about it is ...
12
votes
11answers
2k views

What is the most complicated data structure you have used in a practical situation? [closed]

The germ for this question came up from a discussion I was having with couple of fellow developers from the industry. Turns out that in a lot of places project managers are wary about complex data ...
12
votes
5answers
481 views

Storing in-text metadata in a discrete data structure

I am developing an application which will need to store inline, intext metadata. What I mean by that is the following: let's say we have a long text, and we want to store some metadata connected with ...
12
votes
2answers
2k views

Pseudocode for Brodal queue

I'm trying to find more resources regarding Brodal heap. All I found is a haskell implementation of Brodal-Okasaki heap, but I think that they are skew heaps, is this correct? Furthermore, I'm ...
11
votes
5answers
21k views

Dictionary vs List

So I ran into a Dictionary<int, int> today at work. This just seemed weird to me because I would have probably just used a List<int> instead. Is there a difference and would there be a use ...
11
votes
7answers
3k views

How important is studying algorithms and theory is to becoming a great programmer? [duplicate]

Possible Duplicate: Should I keep investing into data structures and algorithms? I'm a CS student. I want to become a really great programmer, what do I need to do to be come a great ...
11
votes
5answers
1k views

Is there a specific purpose for heterogeneous lists?

Coming from a C# and Java background, I'm used to my lists being homogeneous, and that makes sense to me. When I started picking up Lisp, I noticed that the lists can be heterogeneous. When I started ...
11
votes
1answer
8k 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?
10
votes
7answers
1k views

What are the features required for Object Orientation?

I am just wondering, what exactly are the features a language or a library must provide in order for it to be defined as 'Object Oriented'. Is Object Orientation something that can, more or less, be ...
10
votes
4answers
4k views

EAV - is it really bad in all scenarios?

I'm thinking to use EAV for some of the stuff in one of the projects, but all questions about it in stackoverflow end up to answers calling EAV an anti pattern. But I'm wondering, if is it that wrong ...
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 ...
10
votes
3answers
3k views

AVL Trees and the REAL world

in school we are taught how we can balance an AVL tree upon an insertion or deleting. How is this type of knowledge actually going to be useful in the real world? Can someone give an example on when ...
10
votes
4answers
409 views

Why is it that MS Data Access story is so fractured ? Is it the nature of Data Access or is just MS?

This StackOverflow question asks "where can I get Microsoft.Data.Objects" It turns out the answer was probably that its in the CTP4 (code first) release of Entity Framework 4 However there where a ...
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 ...
10
votes
2answers
495 views

In-memory datastore in Haskell

I want to implement an in-memory datastore for a web service in Haskell. I want to run transactions in the STM monad. When I google hash table steam Haskell I only get this: Data. BTree. HashTable. ...
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? ...
9
votes
2answers
1k views

What is the relationship between data structures and algorithms? [closed]

I have been searching for a good online course in data structures but have found that Google also returns results for algorithms courses, which say stuff like: In this course you will learn ...
9
votes
2answers
2k views

Will B-Trees and Other Data Structures Become Obsolete With The Advent of Solid State Drives?

Many (perhaps most?) database applications today use B-Trees and variations to store data, because this data structure optimizes the read, write and seek operations on a hard disk (and these ...
9
votes
8answers
7k views

Practical way to store a “reasonably large” amount of data that hardly ever changes?

Think in terms of pre-computed lookup tables or something. At what point does it make more sense to use a database instead of hardcoding values in my application? The values are not going to change, ...
9
votes
2answers
687 views

Ideal data structure for storing map data?

I was asked this in an interview test. I did okay on the test but didn't know enough to answer this question. I am curious to know what data structures I can use to query the data quickly. Basically ...
9
votes
7answers
2k views

Data structure for accessing units of measure

TL;DR - I'm looking for the "optimal" data structure to define units within a unit of measure. A Unit of measure is essentially a value (or quantity) associated with a unit. SI Units have seven ...
9
votes
5answers
4k 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 | ...
9
votes
5answers
2k views

What data structure should I use for this caching strategy?

I am working on a .NET 4.0 application, that performs a rather expensive calculation on two doubles returning a double. This calculation is performed for each one of several thousand items. These ...
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 ...
9
votes
2answers
670 views

Uses of persistent data structures in non-functional languages

Languages that are purely functional or near-purely functional benefit from persistent data structures because they are immutable and fit well with the stateless style of functional programming. But ...
9
votes
1answer
450 views

Optimal Data Structure for our own API

I'm in the early stages of writing an Emacs major mode for the Stack Exchange network; if you use Emacs regularly, this will benefit you in the end. In order to minimize the number of calls made to ...
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 ...
8
votes
6answers
2k views

How far to go with typedef'ing primitive types like int

Do you bother typedef'ing most of your number types like this? Or do you just use "int" in most places? It might be more important in my current project with is client / server based and the types ...
8
votes
5answers
10k views

How to quickly search through a very large list of strings / records on a database

I have the following problem: I have a database containing more than 2 million records. Each record has a string field X and I want to display a list of records for which field X contains a certain ...
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, ...