Data Structures and Sorting Algorithms
Moderator: PC Supremacists
- Khearts
- ES Beta Backer
- Posts: 50
- Joined: Sun Oct 10, 2010 5:07 pm
- Current Project: Super Mario Bros Clone and 3D Engine
- Favorite Gaming Platforms: Dreamcast
- Programming Language of Choice: C/++
Data Structures and Sorting Algorithms
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?
- short
- ES Beta Backer
- Posts: 548
- Joined: Thu Apr 30, 2009 2:22 am
- Current Project: c++, c
- Favorite Gaming Platforms: SNES, PS2, SNES, SNES, PC NES
- Programming Language of Choice: c, c++
- Location: Oregon, US
Re: Data Structures and Sorting Algorithms
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
My github repository contains the project I am currently working on,
link: https://github.com/bjadamson
link: https://github.com/bjadamson
- Falco Girgis
- Elysian Shadows Team
- Posts: 10294
- Joined: Thu May 20, 2004 2:04 pm
- Current Project: Elysian Shadows
- Favorite Gaming Platforms: Dreamcast, SNES, NES
- Programming Language of Choice: C/++
- Location: Studio Vorbis, AL
- Contact:
Re: Data Structures and Sorting Algorithms
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.
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
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 itUsually 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
I usually write my own if I know my data has certain quirks that can be optimized.algorithms to sort stuff?
This. If you are writing anything that won't need to have extreme performance, then please use the STD!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.
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.