Best data structure to store DateTime objects in C#? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Best data structure to store DateTime objects in C#?

I would to store a lot of DateTime object in a data structure. No modications will be made after the data structure is filled. Afterwards I would to perform search for certain DateTime values and do some calculations between 2 different values. Which is the best way to do that having performance as a priority?

9th Nov 2016, 9:44 PM
Vasileios Koukoutsas
Vasileios Koukoutsas - avatar
1 Answer
+ 1
Either a List (or) Dictionary would be a right choice for your . Else you can use an IEnumberable<Date-time> and perform lot of Linq queries for your operations.
10th Nov 2016, 6:18 PM
jaipal vallabhaneni
jaipal vallabhaneni - avatar