/soduku.cpp #include <iostream> #include <fstream> #include <stdlib.h> using namespace std; void void bool int* LoadFile(char* filename, int board[81]); PrintBoard(char* filename, int board[81]); UseDigit(int board[81], int digit, int i, int j); Solv
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
Mankinds progress is measured by the number of things we
Binary Search Trees
CIS 350 Data Structures & Algorithm Analysis
Winter 2016
Mohamed Wiem Mkaouer
Slides Reference : Prof. Skiena | Prof. Elenbogen | Prof. Welch
1
Binary Search Trees
Binary search trees provide a data structure which efficiently
supports
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-week project there is time to ask questions.
3. Students c
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
Limited submissions
REVIEW
Todays quiz is on vectors
#incl
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 the node and the data to the right of a
node is greate
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 speeding BST
We can do better than Balanced Binary
Se
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 O() for the worst case time required by the
following
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, 80
80
SHOW THE RESULT OF INSERTING THE
FOLLOWING BINA
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 the node and the data to the right of a
node is greate
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 one or more nodes
such that:
There is a specially designa