Elementary Data Structures
CIS 350 Data Structures & Algorithm Analysis
Winter 2016
Mohamed Wiem Mkaouer
Slides Reference : Prof. Skiena | Prof. Elenbogen | Prof. Welch
1
Elementary Data Structures
Ma
Program1 Debrief
What you should have learned.
2. If you dont understand something you cannot ignore it.
/ Your instructor found comments such as I did not understand
what you wanted
a) In a multi-wee
Review for Quiz 1
ANNOUNCEMENTS
Quiz on Thursday
Reminder that if you use canvas mail expect 48
between responses. Use email
The autograder is unix
When you include iostream, it includes cmath
Limi
CIS 350
Data Structures &
Algorithm Analysis
AVL Trees
Reading: Chap. 4, Weiss
Binary Search Trees
A binary search tree is a binary tree where the
data to the left of any node is less than the
data in
Binary Heaps
BST Review
Worst case
FindMin, DeleteMin and Insert (k) are all O(n)
Best case (completely balanced BST)
FindMin, DeleteMin and Insert (k) are all O(logn)
Binary Heaps
2
Better than a
Review for Quiz 2
FIND THE BEST Q() FOR THE WORST CASE TIME
REQUIRED BY THE FOLLOWING SETS OF CODE
for (int i = 0; i < n*n; i+) / n2
for (int j = 0; j < i; j+) / n2
x+;
/ n4
Q(n4) =Q(n4)
Find the best
Review for Quiz 3
SHOW THE RESULT OF INSERTING THE
FOLLOWING BINARY SEARCH TREE.
Give the preorder traversal
50, 25, 75, 40, 45, 35, 10, 80, 60
50
75
25
10
5
60
40
35
45
50, 25, 10, 40, 35, 45, 75, 60
CIS 350
Data Structures &
Algorithm Analysis
AVL Trees
Reading: Chap. 4, Weiss
Binary Search Trees
A binary search tree is a binary tree where the
data to the left of any node is less than the
data in
CIS 350/3501
Data Structures &
Algorithm Analysis
Trees. Binary Trees.
Reading: Chap.4 (4.1-4.2) Weiss
More Trees Examples
Unix / Windows file structure
Definition of Tree
A tree is a finite set of on