Lecture 5: Dynamic Programming [Fa13]
Algorithms
Those who cannot remember the past are doomed to repeat it.
George Santayana, The Life of Reason, Book I:
Introduction and Reason in Common Sense (1905)
The 1950s were not good years for mathematical resea
Lecture 1: Recursion [Fa13]
Algorithms
The control of a large force is the same principle as the control of a few men:
it is merely a question of dividing up their numbers.
Sun Zi, The Art of War (c. 400 C.E.), translated by Lionel Giles (1910)
Our life
CS515: Algorithms and Data Structures, Fall 2015
Homework 2
Due: Mon, Oct/26/15
Homework Policy:
1. Students should work on homework assignments in groups of preferably three people. Each group submits to
TEACH one set of typeset solutions, and hands in a
Homework 1, Solution Sketches
Hung Le
Baigong Zheng
Problem 1
(a)
We prove the correctness of the algorithm by inducting on the size of the input n.
(i) The base case is when the size of the input is n 2. It is straight forward to verify the
correctness o
CS515: Algorithms and Data Structures, Fall 2015
Homework 1
Due: Mon, Oct/12/15
Homework Policy:
1. Students should work on homework assignments in groups of preferably three people. Each group submits to
TEACH one set of typeset solutions, and hands in a
CS515: Algorithms and Data Structures, Fall 2015
Homework 2
Due: Mon, Oct/26/15
Homework Policy:
1. Students should work on homework assignments in groups of preferably three people. Each group submits to
TEACH one set of typeset solutions, and hands in a
Solving Recurrence Relations
Yen (NTUEE)
Discrete Mathematics 2012
1 / 38
Recurrence Relations
Denition
A recurrence relation for cfw_an is an equation that expresses an in terms
of a0 , . . . , an1 . A sequence is called a solution of a recurrence relat
Basic Rules for
Algebra
&
Logarithmic Functions
Quadratic Formula:
Example:
If p( x) = ax 2 + bx + c , a 0 and 0 b 2 4ac ,
If p( x) = x 2 + 3x 1 =0, with a=1, b=3, and c=-1, then p(x)
Special Factors:
3 13
2
Examples:
x 2 a 2 = ( x a)( x + a)
x 2 9 = ( x
Algorithms
Appendix I: Proof by Induction [Fa13]
Jeder Genieende meint, dem Baume habe es an der Frucht gelegen;
aber ihm lag am Samen.
[Everyone who enjoys thinks that the fundamental thing about trees is the
fruit,
but in fact it is the seed.]
Friedric
CS515: Algorithms and Data Structures, Fall 2015
Homework 1
Due: Mon, Oct/12/15
Homework Policy:
1. Students should work on homework assignments in groups of preferably three people. Each group submits to
TEACH one set of typeset solutions, and hands in a
Problem 1 of HW2 Solution
Hung Le
Problem 1 Suppose that |T | = n and |T 0 | = m. For each pair of nodes u T and u0 T 0 ,
we denote the subtrees rooted at u and u0 by T [u] and T 0 [u0 ], respectively. If T [u] and T 0 [u0 ] are
isomorphic, we write T [u]
Homework 4 - CS 515
Algorithm and Data Structures
Khoi Nguyen & Ni Ni Trieu (932-698-762) & Ritesh Sharma
November 30, 2015
Problem 1. Algorithm:
1st step: Lets U, V be a set of n, m vertices respectively, i.e. U = cfw_ui , i [1.n], V =
cfw_vj , j [1.m],
Fall 2015 CS515 Algorithm
Homework 3 Report
Francis Phong Vo
Kazuki Kaneoka
Zixuan Zhao
Problem 1
(a)
Lemma 1
For any flow f, there is an acyclic flow with the same value as f.
Direct Proof
1. Let f be a cyclic flow and let |f| be a value of f.
2. Suppose
AlgorithmandDataStructures
Homework2
GroupMember:YuZhang,HaoxiangWang,KuiWang
Discussedwith:YuanZhangsgroup,ParisKalathasGroupandChenyuWangs
group
Problem1:
a)
O
rderedTree:
Beforeexplaintheprocessofthealgorithm,weneedtodefinesomeconcepts:
level
:anodesle
Algorithms
Lecture 9: Randomized Algorithms [Sp15]
The first nuts and bolts appeared in the middle 1400s. The bolts were just screws with straight
sides and a blunt end. The nuts were hand-made, and very crude. When a match was found
between a nut and a b
Algorithms
Lecture 23: Maximum Flows and Minimum Cuts [Fa13]
A process cannot be understood by stopping it. Understanding must
move with the flow of the process, must join it and flow with it.
The First Law of Mentat, in Frank Herberts Dune (1965)
Theres
Algorithms
Lecture 13: Randomized Minimum Cut [Fa13]
Jaques: But, for the seventh cause; how did you find the quarrel on the seventh cause?
Touchstone: Upon a lie seven times removed:bear your body more seeming, Audrey:as
thus, sir. I did dislike the cut
Algorithms
Lecture 24: Applications of Maximum Flow [Fa13]
For a long time it puzzled me how something so expensive, so leading edge,
could be so useless, and then it occurred to me that a computer is a stupid
machine with the ability to do incredibly sma
Algorithms
Lecture 27: Linear Programming Algorithms [Fa13]
Simplicibus itaque verbis gaudet Mathematica Veritas, cum etiam per
se simplex sit Veritatis oratio. [And thus Mathematical Truth prefers
simple words, because the language of Truth is itself sim
Algorithms
Lecture 26: Linear Programming [Fa 13]
The greatest flood has the soonest ebb;
the sorest tempest the most sudden calm;
the hottest love the coldest end; and
from the deepest desire oftentimes ensues the deadliest hate.
Socrates
Th extremes of
CS515 Homework Assignment #4
November 30, 2015
Mahabub Alam, Tadesse Zemichael, Michael Slater
Solution:
Given: matrix = cfw_, of real numbers
row sum: = , , column sum: = ,
Goal: Round each , , as well as and up or down to the next integer so that the s
Algorithms
Lecture 10: Treaps and Skip Lists [Fa13]
I thought the following four [rules] would be enough, provided that I made a firm and constant
resolution not to fail even once in the observance of them. The first was never to accept
anything as true i
Homework 1 for CS 515
Baigong Zheng
1.(a) Let line segment si be the segment between pi and qi . Two line segments si and
sj intersect only when (pi pj )(qi qj ) < 0. So we can check if each pair of segments
( )
intersect in O(1) time. Since there are n2
CS515: Algorithms and Data Structures, Fall 2016
Homework 4
Due: Tue, 11/29/16
Homework Policy:
1. Students should work on homework assignments in groups of preferably three people. Each group submits to
TEACH one set of typeset solutions, and hands in a
CS515: Algorithms and Data Structures, Fall 2016
Homework 3
Due: Tue, Nov/15/16
Homework Policy:
1. Students should work on homework assignments in groups of preferably three people. Each group submits to
TEACH one set of typeset solutions, and hands in a
CS515: Algorithms and Data Structures, Fall 2016
Homework 2
Due: Tue, 10/25/16
Homework Policy:
1. Students should work on homework assignments in groups of preferably three people. Each group submits to
TEACH one set of typeset solutions, and hands in a
1)
At first we consider a tree with inorder and preorder traversal. If the preorder and the inorder traversal
contains elements then we fetch the 0th index value of the preorder which we set as the value of the
node. As we know the 0th index of preorder c