1 / 18

DATA STRUCTURES & C # GENERICS

DATA STRUCTURES & C # GENERICS . Trent Spangler | Greg Phelps. OUTLINE. Data Structures Importance Definition Examples Different Structure Types Uses. C# Generics Definition Pros & Cons In Depth . Why are data structures important?. Store and manage large amounts of data efficiently

rhonda
Download Presentation

DATA STRUCTURES & C # GENERICS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. DATA STRUCTURES & C# GENERICS Trent Spangler | Greg Phelps

  2. OUTLINE Data Structures • Importance • Definition • Examples • Different Structure Types • Uses C# Generics • Definition • Pros & Cons • In Depth

  3. Why are data structures important? • Store and manage large amounts of data efficiently • Databases • Sorting or Indexing Services. • Search structures for information we want

  4. DATA STRUCTURES “A particular way of storing and organizing data.”

  5. Real-world Examples

  6. Structure Types Array Linked List Sorted List Trees Hash Table Queues & Stacks

  7. Arrays “systematic arrangement of objects, usually in rows and columns” 1, 2, and 3 Dimensional

  8. Linked List Data stored in a “node” which means it contains data and a reference to the next node in the sequence Advantage: Easy insertion or deletion without reorganization Disadvantage: Must search from the beginning because lists are sequential/ordered

  9. Sorted List Similar to Linked List “Nodes” are sorted and are inserted accordingly

  10. Trees Each “node” has no more than two children, referred to as left and right. Example

  11. Hash Table Value = phone # Key = Sandvig Hash(Sandvig)  5 Hash(Gandalf)  5

  12. Queues & Stacks Push: insert Pop: extract Peek: examine

  13. STACTIVITY

  14. GENERICS What are they?

  15. A simple definition: “Generics allow you to define type-safe data structures, without committing to actual data types.”

  16. Pros • Code Reusability • Type Safety • Increased performance from less code • Cons • Complexity • Learning curve GenericsPros & Cons Mainly used with collections/data structures

  17. Generics In Depth Dracula Explanation of Generics Information is stored in objects instead of variables Note: You cannot implicitly convert type object to other data types (int, string, etc.)

  18. http://en.wikipedia.org/wiki/Data_structure • http://en.wikipedia.org/wiki/Main_Page • http://codersbarn.com/post/2008/04/09/What-are-C-Generics-Part-I.aspx REFERENCES

More Related