Dynamic array(request)

Forum for plugin, effect and behavior programmers. Please use the Help & Support forum for help using Construct.

Post » Thu Jun 11, 2009 11:59 am

What about linked lists? Does construct include these?

Linked lists are very efficient data structures for handling large amounts of objects, as each element in the list knows the previous and next objects in the list. If an object is removed you simple update the links for the previous and next objects, not the entire list.

Lots of info about data structures here:
http://lab.polygonal.de/ds/
B
2
S
2
G
3
Posts: 105
Reputation: 1,510

Post » Thu Jun 11, 2009 4:22 pm

More data containers are needed, but I'm not convinced that many if any uses yet would require such optimized containers. Could be wrong though.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Thu Jun 11, 2009 10:39 pm

actually I've read in many places that you shouldn't use lists and other dynamic structures for stuff that changes a lot.
Turns out allocating memory is rather slow, so it's better to have an array/pool of resources and activate/desactivate when needed. Creating a new one is activating a deactivated resource and overwriting its values.

You can do that with arrays already. I could post an example if needed.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Thu Jun 11, 2009 11:13 pm

The overhead of the event engine is high, so the algorithmic benefits of various containers would probably be much less noticable.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Previous

Return to Construct engineering

Who is online

Users browsing this forum: No registered users and 0 guests