Page 1 of 1
Data Structures and Sorting Algorithms
Posted: Tue May 17, 2011 2:22 am
by Khearts
Usually when I work on my development, usually I stick to the basic STL things like vectors and hash maps. Do programmers here tend to use other structures like LinkedLists, Queues, or other structures to hold data or algorithms to sort stuff?
Re: Data Structures and Sorting Algorithms
Posted: Tue May 17, 2011 10:52 am
by short
You can get away with vectors for now, but really I use all of them now. Since you have a lot of the different structures available from the STL or boost once you figure out what type of operations you perform most frequently on your data structure (lookup, insertion in the beginning/middle/end) look up what data structure best suits your needs. It's really about how fast the operations you perform are what should determine what data structure to use. Some data structures are smaller then others if memory use is a concern. Just jump on Wikipedia it will tell you the complexity of all the operations for each data structure
Re: Data Structures and Sorting Algorithms
Posted: Tue May 17, 2011 12:31 pm
by Falco Girgis
It really all depends. STL used to be a gigantic taboo for game development with the previous Dreamcast/PS2/Gamecube/Xbox generation, due to limited resources. With modern console/PC development and things like XNA, you're seeing more and more developers use STL.
For embedded devices like phones or microprocessors with applications that demand performance, you really won't see too much STL, though.
Re: Data Structures and Sorting Algorithms
Posted: Tue May 17, 2011 2:48 pm
by bnpph
Usually when I work on my development, usually I stick to the basic STL things like vectors and hash maps. Do programmers here tend to use other structures like LinkedLists, Queues
Every data structure has a purpose, and I have used all of them. My favorite is the stack, but unfortunately STD has a shitty version of it
algorithms to sort stuff?
I usually write my own if I know my data has certain quirks that can be optimized.
It really all depends. STL used to be a gigantic taboo for game development with the previous Dreamcast/PS2/Gamecube/Xbox generation, due to limited resources. With modern console/PC development and things like XNA, you're seeing more and more developers use STL.
For embedded devices like phones or microprocessors with applications that demand performance, you really won't see too much STL, though.
This. If you are writing anything that won't need to have extreme performance, then please use the STD!
There is also EASTL made by EA, which is designed for their games:
http://www.open-std.org/jtc1/sc22/wg21/ ... n2271.html
I have never used it.
Been working on my own library which is being designed to be a replacement for STD for video games. It should run extremely fast if you use it right.