Thursday, June 18, 2009

Collections and Data Structures

•Closely related data can be handled more efficiently when grouped together into a collection.
• Instead of writing separate code to handle each individual object, you can use the same code to process all the elements of a collection
•To manage a collection, use the Array class and the System.Collection classes to
•add
•remove &
• modify
either individual elements of the collection or a range of elements.
•An entire collection can even be copied to another collection
•Some Collections classes have sorting capabilities, and most are indexed.
•Memory management is handled automatically, and the capacity of a collection is expanded as required.
•Synchronization provides thread safety when accessing members of the collection.
•Some Collections classes can generate wrappers that make the collection read-only or fixed-size.
• Any Collections class can generate its own enumerator that makes it easy to iterate through the elements
•System.Collections.Generic
•System.Collections.ObjectModel
are the namespaces used for the collections

No comments:

Post a Comment