CSc 345: Analysis of Discrete Structures (Spring 16)
Final Exam (Review)
1. (20 points) For each of the parts below, give a short answer (a few words or symbols, or perhaps a short
sentence).
(a) Use quantifiers to express the proposition that, for all po
Homework 3 Solutions
Qiyam Tung
June 29, 2014
Problem 1
Brief description/reminders of insertion sort:
When adding new element to list, |list|-1 is already sorted.
Insertion sort will compare and swap until it reaches an element that is equal or less th
CSc 345: Analysis of Discrete Structures
Spring 16 (Lewis)
Exam 1 (Review)
1. For each of the parts below, give a short answer (a few words or symbols, or perhaps a short sentence).
(a) Explain the difference between big-O and Theta. Then give an example
CSc 345: Analysis of Discrete Structures
Spring 2016 (Lewis)
HW 3
due at the beginning of lecture: Mon 15 Feb 2016
WARNING: No late work will be accepted on this assignment
1
Recursion Trees
Draw a recursion tree for the recurrence
T (n) = 3T (
3n
) + cn
To be reviewed on Wednesday, June 23, at 9 AM (GMT-7)
CSc 345 Summer 2014
Instructor: Qiyam Tung
Sample problems
3
A
2
B
C
4
5
3
D
7
5
F
1
E
12
G
Figure 1: A weighted undirected graph G
1. What is the degree of B?
2. What is the length of the path A-F-E-B
Quiz 2
Thursday July 12
CSc 345 Summer 2012
Qiyam Tung
Name
Instructions
1. This is an individual assignment. You must do your own work.
2. Show all work. Incomplete solutions will not receive full credit
Problem 1 (6 Points)
Find the correct closed-form
Quiz 6
Thursday July 31
CSc 345 Summer 2012
Qiyam Tung
Name
Instructions
1. This is an individual assignment. You must do your own work.
2. Show all work. Incomplete solutions will not receive full credit
Problem 1 (5 Points)
Build a max heap in O(n) time
CSc 345: Analysis of Discrete Structures
Spring 2016 (Lewis)
HW 4
due at the beginning of lecture: Mon 28 Mar 2016
WARNING: No late work will be accepted on this assignment
1
AVL Trees
1. Draw two different AVL trees which contain the same values (1-15) b
Quiz 4
Tuesday July 23
CSc 345 Summer 2012
Qiyam Tung
Name
Instructions
1. This is an individual assignment. You must do your own work.
2. Show all work. Incomplete solutions will not receive full credit
Problem 1 (8 Points)
Given two hash functions: h1 (
AVL Trees
AVL Property
Insertion
Deletion
Summing it all up
1
AVL Trees
AVL trees are special BSTs:
Keep track of height of every subtree.
At each node, require left and right subtrees to
differ in height by 1 or less.
by G. M. Adelson-Velsky and E. M. La