c# - Calculate best collection to use in method -


i have search method in custom a* algorithm. uses collection keep track of search doing. set path know doing following collection: contains 860x (lookup) remove 91x add 270x

the order or sorting not matter unless can find way order it. possible generate unique id each node based on x , y value. making dictionary lookup possible.

is there way calculate based on method, best collection use in specific case?

thanks in advance, smiley

the general census says:

  1. if don't run performance issues, leave alone.
  2. if , can away it, leave alone.
  3. if do, can't (or love code tight), benchmark it, , you'll find.

(clarification: didn't use "premature optimization root of evil" reference, because think there place optimization. here's good article subject).

from you're saying, doubt it'll make change, unless you're running on device next no resources, again, unless need it, above numbers, doubt you'll see difference.

edit:
per chat room continuation, suggest looking hashtable , dictionary. more specific, sorted dictionary :) .
interesting read hashtable vs dictionaries in c#, can @ this question , at one.

good luck, , feel free post results others learn.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -