Data Structures and Algorithms for Game Programming

Started by
19 comments, last by Gage64 14 years ago
I wanna know more about these things, can anyone show something like link about this... i tried googling, but there were only books about this...

Deltron Zero and Automator.

Advertisement
Data structures and algorithms are overemphasized.

In 95% of cases, you're better off using a standard container in the language you're using (a hashmap, an array list, a linked list, whatever).

It's only when you are well into making your game and you're trying to squeeze out those last few frames per second do you need to resort to fancy structures.

Wikipedia is a good place to start. What kind of data structures in particular are you looking for information on?
Quote:Original post by Tac-Tics
Data structures and algorithms are overemphasized.

In 95% of cases, you're better off using a standard container in the language you're using (a hashmap, an array list, a linked list, whatever).


If you don't know the basic principles behind the data structures that the containers use, how will you know which container is more appropriate in a particular situation?
Quote:Original post by Gage64
If you don't know the basic principles behind the data structures that the containers use, how will you know which container is more appropriate in a particular situation?


If you need a way to look up an object by a string identifier, you use a hash.

If you need a way to look up an object by an integer identifier, you use an array list.

If you need to look up an object by something else, you use hashes if your language supports it or a linear search on an array list otherwise.

These three rules will give you the best solution most of the time.

I'm not saying that binary trees or red-black trees or skip lists or heaps aren't at all useful. They just aren't useful most of the time. They are optimizations. You fall back on them only after your code fails to scale with naive methods.
You didn't answer his question.

If you don't know about the data structures (just aware of their existence and their use; completely ignore implementation) then how will you know what container to use (which is based on and implemented from said data structures) properly?

Beginner in Game Development?  Read here. And read here.

 

Quote:Original post by Alpha_ProgDes
You didn't answer his question.


The answer was check Wikipedia.

Here's more than you'll ever need:

http://en.wikipedia.org/wiki/List_of_data_structures
Get a good book on data structures or take a class (really only available in college). It's definitely something you want to know about if only to be able to get a job: data structure questions are the singular biggest bucket of questions you'll get asked (whether you think it's important or not is irrelevant)

The list that TicTac posted is a good place to start for sure.

-me
Quote:
It's definitely something you want to know about if only to be able to get a job: data structure questions are the singular biggest bucket of questions you'll get asked (whether you think it's important or not is irrelevant)


Not in my experience. I've seen very few data structure questions in interviews (from both sides of the fence), mostly for the reason Tac-Tics pointed out originally. You have maybe 2-3 major structures that are part of the standard library that are good enough for almost everything.

They're still useful to learn, but not exactly a primary concern if I were going into an interview tomorrow.
Quote:Original post by Telastyn
They're still useful to learn, but not exactly a primary concern if I were going into an interview tomorrow.


Yeah.

Data structures and algorithms belong to the academic domain. They are mathematically interesting and there are enough variations on each of them to keep PhDs employed.

In a job interview, though, you're in an industrial domain. The interviewer will typically be more interested in what technologies you know and what professional work you've done.

Even the really keen employers won't really care if you can tell a Red-Black tree from an AVL tree. They'll just want to see if you can reason about a hard problem.
Quote:Original post by Tac-Tics
Data structures and algorithms belong to the academic domain. They are mathematically interesting and there are enough variations on each of them to keep PhDs employed.
What?!

When you create a class or a struct, you are creating a data structure.

Every line of code you write is part of an algorithm, or else it is dead code.

So I'm going to have to disagree with that. Data structures and algorithms are the foundation of computer programming.


I don't know why when the OP wrote "algorithm" you interpreted it as "container". Containers are an infinitesimally small subset of algorithms.

This topic is closed to new replies.

Advertisement