data structures & c # generics

Post on 19-Feb-2016

41 Views

Category:

Documents

3 Downloads

Preview:

Click to see full reader

DESCRIPTION

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 - PowerPoint PPT Presentation

TRANSCRIPT

DATA STRUCTURES & C# GENERICS

Trent Spangler | Greg Phelps

OUTLINEData 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• Databases• Sorting or Indexing Services.

• Search structures for information we want

DATA STRUCTURES

“A particular way of storing and

organizing data.”

Real-world Examples

Structure Types

ArrayLinked ListSorted List

TreesHash Table

Queues & Stacks

Arrays“systematic

arrangement of objects, usually in rows and

columns”

1, 2, and 3 Dimensional

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

Sorted ListSimilar to Linked List“Nodes” are sorted and are inserted accordingly

Hash Table

Value = phone #Key = SandvigHash(Sandvig) 5Hash(Gandalf) 5

Queues & Stacks

Push: insertPop: extractPeek: examine

STACTIVITY

GENERICSWhat are they?

A simple definition:

“Generics allow you to define type-

safe data structures, without

committing to actual data types.”

GenericsPros & Cons

• Pros• Code Reusability• Type Safety• Increased performance from

less code

• Cons• Complexity• Learning curve

Mainly used with collections/data

structures

Generics In Depth

• Information is stored in objects instead of variables

• Note: You cannot implicitly convert type object to other data types (int, string, etc.)

DraculaExplanation

ofGenerics

top related