Jump to content
  • Advertisement


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

Roof Top Pew Wee

Strongly typed arrays and sorting in C#.

This topic is 5448 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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!