Archived

This topic is now archived and is closed to further replies.

Strongly typed arrays and sorting in C#.

This topic is 5110 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I wanted a strongly typed array, so I just made a class inherited from CollectionBase with the Add and Remove methods and also put a property in. But I want to sort the array as well, so is it possible to inherit the ArrayList and do the same thing, but utilize the sort function? --Vic-- Actually, while I'm at it, here's another question. I used to sort with a linked list in C++. Would it be best to stick with this for speed purposes? Or does the sort function in the ArrayList class compete in speed. [edited by - Roof Top Pew Wee on December 13, 2003 9:03:25 PM]

Share this post


Link to post
Share on other sites
As a general rule, you can inherit any class you want without fear of breaking things. But then again, all general rules are wrong.

I would think that quicksorting an array would be faster than a linked list. Insertion sort would be about as fast either way, though.


"Without deviation, progress itself is impossible." -- Frank Zappa

Share this post


Link to post
Share on other sites