0
Upcoming SlideShare
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Standard text messaging rates apply

# DSA - Lecture 03

3,604

Published on

Published in: Education
0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total Views
3,604
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
94
0
Likes
0
Embeds 0
No embeds

No notes for slide

### Transcript

• 1. Collections and Generics Dr.Haitham A. El-Ghareeb Information Systems Department Faculty of Computers and Information Sciences Mansoura University helghareeb@gmail.com September 30, 2012Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 30, 2012 1 / 13
• 2. Good News Received: 23 September 2012Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 30, 2012 2 / 13
• 3. Good News http://www.helghareeb.me/courses/dsa-2012Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 30, 2012 3 / 13
• 4. Collections Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 30, 2012 4 / 13
• 5. Collections A collection is a structured data type that stores data and provides operations for adding data to the collection. Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 30, 2012 4 / 13
• 6. Collections A collection is a structured data type that stores data and provides operations for adding data to the collection. Operations include: Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 30, 2012 4 / 13
• 7. Collections A collection is a structured data type that stores data and provides operations for adding data to the collection. Operations include: removing data from the collection Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 30, 2012 4 / 13
• 8. Collections A collection is a structured data type that stores data and provides operations for adding data to the collection. Operations include: removing data from the collection updating data in the collection Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 30, 2012 4 / 13
• 9. Collections A collection is a structured data type that stores data and provides operations for adding data to the collection. Operations include: removing data from the collection updating data in the collection and operations for setting and returning the values of diﬀerent attributes of the collection. Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 30, 2012 4 / 13
• 10. Collection TypesCollections can be broken down into two types: linear and nonlinear. Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 30, 2012 5 / 13
• 11. Collection TypesCollections can be broken down into two types: linear and nonlinear. A linear collection is a list of elements where one element follows the previous element. Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 30, 2012 5 / 13
• 12. Collection TypesCollections can be broken down into two types: linear and nonlinear. A linear collection is a list of elements where one element follows the previous element. Elements in a linear collection are normally ordered by position (ﬁrst, second, third, etc.). Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 30, 2012 5 / 13
• 13. Collection TypesCollections can be broken down into two types: linear and nonlinear. A linear collection is a list of elements where one element follows the previous element. Elements in a linear collection are normally ordered by position (ﬁrst, second, third, etc.). Nonlinear collections hold elements that do not have positional order within the collection. Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 30, 2012 5 / 13
• 14. Collection TypesCollections can be broken down into two types: linear and nonlinear. A linear collection is a list of elements where one element follows the previous element. Elements in a linear collection are normally ordered by position (ﬁrst, second, third, etc.). Nonlinear collections hold elements that do not have positional order within the collection. An organizational chart is an example of a non- linear collection. Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 30, 2012 5 / 13
• 15. Collection Properties and MethodsDr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 30, 2012 6 / 13
• 16. Collection Properties and Methods Collection Property is the collections Count, which holds the number of items in the collection.Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 30, 2012 6 / 13
• 17. Collection Properties and Methods Collection Property is the collections Count, which holds the number of items in the collection. Collection operations, called methods, include: Add (for adding a new element to a collection) Insert (for adding a new element to a collection at a speciﬁed index) Remove (for removing a speciﬁed element from a collection) Clear (for removing all the elements from a collection) Contains (for determining if a speciﬁed element is a member of a collection)Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 30, 2012 6 / 13
• 18. Linear Collections Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 30, 2012 7 / 13
• 19. Linear Collections Direct Access Collections Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 30, 2012 7 / 13
• 20. Linear Collections Direct Access Collections Sequential Access Collections Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 30, 2012 7 / 13
• 21. Linear Collections Direct Access Collections Sequential Access Collections Generalized Indexed Collections Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 30, 2012 7 / 13
• 22. Struct DEMO Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 30, 2012 8 / 13
• 23. Non Linear Collections Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 30, 2012 9 / 13
• 24. Non Linear Collections Hierarchical Collections Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 30, 2012 9 / 13
• 25. Non Linear Collections Hierarchical Collections Group Collections Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 30, 2012 9 / 13
• 26. My Collection Class DEMO Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 30, 2012 10 / 13
• 27. Generic Programming DEMODr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 30, 2012 11 / 13
• 28. Oversimpliﬁed Timing Tests DEMODr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 30, 2012 12 / 13
• 29. Charting in .Net DEMO Dr.Haitham A. El-Ghareeb (CIS) Data Structures and Algorithms - 2012 September 30, 2012 13 / 13