Best data Structure

Oct 26, 2004 1 Replies

Hello All,



My Need : My application need to log all the trace messages. I dont want to loose even one.



My Question : Which data strcuture is the best ? Dont worry about thread scheduling or something . I just want to know which one will be the most efficient?



My Ideas :



STL Vector : Thought of it but removed it bcos it costed lot of copies.



STL Deque : Thinking about it ? What you guys say ?



Auto Pointer : Array of auto pointers



Please let me know your views.



Thanks Rakesh


This is a lot like asking what color is best. In the absence of more information any answer must have a high degree of subjectivity.

Are these trace messages being written to disk? flash memory? printer? Do you care if messages are lost due to power failure? What format are the messages in? Are they being stored at the point where they are generated or are they passed on? When you say "most efficient", do you mean in terms of space or time or something else?

The answers to each of these questions can have a large impact upon the decision of how, where and how long to store messages.

Good luck

Joe Power

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required