1
SORT ALGORITHM
EXAMPLES
23 May 2014
Ps-Gzde ALP
2
HeapSort
Example1: Sort the following string of letters in ascending
order using heapsort.
GOODLUCK
3
Example 2: Consider the array below. Sort the following
array in ascending order using heapsort.
4
QU

Data Structures Week #4
Queues
Outline
Queues
Operations on Queues
Array Implementation of Queues
Linked List Implementation of Queues
Queue Applications
5.Kasm.2009
Borahan Tmer, Ph.D.
2
Queues (Kuyruklar)
A queue is a list of data with the restriction t

Data Structures Week #3
Stacks
Outline
Stacks
Operations on Stacks
Array Implementation of Stacks
Linked List Implementation of Stacks
Stack Applications
10/15/12
Borahan Tmer, Ph.D.
2
Stacks (Ynlar)
A stack is a list of data with the restriction
that dat

Data Structures Week #7
Hashing
Outline
Motivation for Hashing
Underlying Idea
Hash Tables
Hash Functions
Separate Chaining
Open Addressing
Rehashing
21.Aralk.2011
Borahan Tmer, Ph.D.
2
Hashing
21.Aralk.2011
Borahan Tmer, Ph.D.
3
Motivation for Hashing
K

Data Structures Week #1
Introduction
Contents
A Review on C (MM Repr., Operations,
Passing to Functions, etc .)
Strings,
Arrays
Pointers
Types of Function Invocation (Call by Value,
Call by Reference)
07/11/13
Fatma Corut Ergin
2
C Program Structure
A C p

Data Structures Week #2
Algorithm Analysis
&
Recursion
Outline
Need for Efficiency
Big Oh Notation
Analysing the Algorithm
Execution Time Examples
Recurrence Examples
November 10, 2006
Fatma CORUT ERGN
2
Why we need efficient programs
An Optimisation Prob

Data Structures Week #1
Introduction
Contents
A Review on C (MM Repr., Operations,
Passing to Functions, etc .)
Strings,
Arrays
Pointers
Types of Function Invocation (Call by Value,
Call by Reference)
Math. Review
November 10, 2006
Fatma Corut Ergin
2
C P

Data Structures Week #5
Trees (Aalar)
Trees (Aalar)
Toros Gknar
21.Aralk.2010
Avrupa Gknar
Borahan Tmer, Ph.D.
2
Trees (Aalar)
21.Aralk.2010
Borahan Tmer, Ph.D.
3
Outline
Trees
Definitions
Implementation of Trees
Binary Trees
Tree Traversals & Expression

Data Structures Week #6
Special Trees
Outline
Adelson-Velskii-Landis (AVL) Trees
Splay Trees
B-Trees
21.Aralk.2010
Borahan Tmer, Ph.D.
2
AVL Trees
21.Aralk.2010
Borahan Tmer, Ph.D.
3
Motivation for AVL Trees
Accessing a node in a BST takes O(log2n) in

CSE225 Data Structures
Fatma Ergin
Summer 2013
Quiz #3(Closed books/notes)
Student Name:_
Student Number:_
Q1. (20+5 = 25pts)
Consider the following AVL tree.
a) Insert 17 to the tree. If any AVL condition violation
exists, show the node and perform the a

CSE225 Data Structures
Fatma Ergin
Spring 2011
Quiz #2(Closed books/notes)
Student Name:_
Student Number:_
Q1. (40pts)
Suppose that you have a piece of code which
i. reads DATASTRUCTURESCLASSMARMARA in,
ii. every time it reads a letter, finds it in a BST

Data Structures Week #5
Trees (Aalar)
Trees (Aalar)
Avrupa Gknar
Toros Gknar
October 5, 2015
Borahan Tmer, Ph.D.
2
Trees (Aalar)
October 5, 2015
Borahan Tmer, Ph.D.
3
Outline
Trees
Definitions
Implementation of Trees
Binary Trees
Tree Traversals & Express

Data Structures Week #3
Stacks
Outline
Stacks
Operations on Stacks
Array Implementation of Stacks
Linked List Implementation of Stacks
Stack Applications
October 5, 2015
Borahan Tmer, Ph.D.
2
Stacks (Ynlar)
A stack is a list of data with the restriction
t

Data Structures Week #1
Introduction
Components of a Computer and
their Interconnections
October 5, 2015
Borahan Tmer, Ph.D.
2
Goals
We will learn methods of how to
(explicit goal) organize or structure large
amounts of data in the main memory (MM)
consid

Data Structures Week #4
Queues
Outline
Queues
Operations on Queues
Array Implementation of Queues
Linked List Implementation of Queues
Queue Applications
October 5, 2015
Borahan Tmer, Ph.D.
2
Queues (Kuyruklar)
A queue is a list of data with the restricti

1
HEAP EXAMPLES
7 May-9 May 2014
Ps-Gzde ALP
2
Max-Min heap
Max Heap:
Min Heap:
3
Max-Heap Build Heap
Example 1: Construct a binary max-heap using the following sequence of
numbers show heap in each step.
15,7,12,28,36,1,37,13,4,25,3,9,27,2,5,16
4
Max-Hea

Data Structures Week #7
Hashing
Outline
Motivation for Hashing
Underlying Idea
Hash Tables
Hash Functions
Separate Chaining
Open Addressing
Rehashing
October 5, 2015
Borahan Tmer, Ph.D.
2
Hashing
October 5, 2015
Borahan Tmer, Ph.D.
3
Motivation for Hashin

Data Structures Week #6
Special Trees
Outline
Adelson-Velskii-Landis (AVL) Trees
Splay Trees
B-Trees
October 5, 2015
Borahan Tmer, Ph.D.
2
AVL Trees
October 5, 2015
Borahan Tmer, Ph.D.
3
Motivation for AVL Trees
Accessing a node in a BST takes O(log2n

1
GRAPH ALGORITHM
EXAMPLES
Ps-Gzde ALP
2
DFS Algorithm
Example 1: Apply DFS(Depth First Search) algorithm starting at vertex e.
Visit adjacent vertices obsorving the alphabetical order.
3
Result:
4
Example2: Apply the above graph topological sort using t

Data Structures Week #9
Sorting
Outline
Motivation
Types of Sorting
Elementary (O(n2) Sorting Techniques
Other (O(n*log(n) Sorting Techniques
October 5, 2015
Borahan Tmer, Ph.D.
2
Sorting
October 5, 2015
Borahan Tmer, Ph.D.
3
Motivation
Sorting is a fund