I am looking for a data structure in C# (.net framework) which I can use to add data in sorted order (instead of adding all data and then applying sort). My data are objects and I want to add them according to a certain field (integer field).
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
option 1) use the SortedList and use your integer fields as key.
option 2) use SortedSet but be cautious .. this collection can only contain unique objects (no duplicates of the same object)