DSA - Lecture 03
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
3,911
On Slideshare
1,823
From Embeds
2,088
Number of Embeds
1

Actions

Shares
Downloads
91
Comments
0
Likes
0

Embeds 2,088

http://mj89sp3sau2k7lj1eg3k40hkeppguj6j-a-sites-opensocial.googleusercontent.com 2,088

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    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 different 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 (first, 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 (first, 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 (first, 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 specified index) Remove (for removing a specified element from a collection) Clear (for removing all the elements from a collection) Contains (for determining if a specified 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. Oversimplified 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