Home » Community » Coffee corner » alternative to array of linked list
Re: alternative to array of linked list [message #46370 is a reply to message #46369] |
Mon, 02 May 2016 01:55 |
Lance
Messages: 549 Registered: March 2007
|
Contributor |
|
|
Linked list may not be a good option for this application.
In general, you will be happy with O(logN) insert,delete,search time complexity. std::set, set::map, std::unordered_set, set::unordered_map, or u++ VectorMap should all be good candidate. Maybe even Upp::InVector (I am not sure though). If class Particle is of considerable size, you can put them in either a Upp::Vector or a std::vector, and actually put its index in the vector in cell's particles container.
experiment with std::set, set::unordered_set, Upp::VectorMap etc, see which offer best performance for your application.
|
|
|
Goto Forum:
Current Time: Sat Sep 21 00:32:28 CEST 2024
Total time taken to generate the page: 0.03027 seconds
|