You are on page 1of 15

Data Structures

EHB208E

1
Grading

Grading Method
Two Midterm Exams: %50
One Homework: %10
Final Exam: %40

2
Bad programmers worry about the code.

Good programmers worry about data


structures and their relationships.”

-Linus Torvalds, creator of Linux


What is Data Structures?

• Example: library
– is composed of elements
(books)
– Accessing a particular book
requires knowledge of the
arrangement of the books
What is Data Structures?
In computer science, data structure is a data
organization, management and storage format that
enables efficient access and modification.

More precisely, a data structure is a collection of data


values, the relationships among them, and the
functions or operations that can be applied to the
data.
What will we study?
• Algorithms and their implementations
• Stacks and Queues

• Linear lists

• Trees

• Graphs

• Sorting algorithms and searching algorithms


6
From Data to Information
RAW DATA= 0100 0010 0100 0001 0100 0010 0100 0001

CHAR DATA TYPE (ASCII) = 0100 0010 0100 0001 0100 0010 0100 0001
B A B A

16 BIT INTEGER = 0100 0010 0100 0001 0100 0010 0100 0001
16961 16961

32 BIT INTEGER= 0100 0010 0100 0001 0100 0010 0100 0001
1111573057
Understanding Data And Structure

Data = Information

Structure = Organization

Data Structure = Information Organization


Arrays as a Data Structure

Elements Placed Consecutively

Address Of Each Element Known

Fixed Size
Stacks

Last In First Out (LIFO)

One End For Addition And


Removal Of Data
Queues

First In First Out (FIFO)

One End For Addition And The Other End For Removal
Of Data
Linked List

Dynamic Data Structure

Address Of Each Elements Not Known Directly

No Fixed Size
Tree

Hierarchical Data Structure

Consists Of :
• Root Node
• Parent Child Relationship
• Leaf Nodes
Graph

Consists Of:
• Edges
• Vertices

Also known as
Adjacency Matrix
Which Data Structure Is Right For You?

Size is known - Array

Size is unknown - LinkedList


Computing applications – Stacks and Queues

Hierarchical Relationships – Tree and Graph

You might also like