Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
Lance is currently offline  Lance
Messages: 527
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.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: MT opens up whole new can of worms :)
Next Topic: Outage...
Goto Forum:
  


Current Time: Fri May 10 22:15:28 CEST 2024

Total time taken to generate the page: 0.01948 seconds