Introduction to Algorithms Massachusetts Institute of Technology Professors Erik D. Demaine and Charles E. Leiserson
September 21, 2005
6.046J/18.410J
Handout 6
Problem Set 2
MIT students: This problem set is due in lecture on Monday, October 3, 2005. T
E L,K 4
R ! G
* U
F kx ; ,*GU"JS$",*"cfw_!zD
1S$, 4 ' ! ! G cfw_ #
G m; 9"*!,(/"n"G"J"G N ,*#,#*"'G nx 4 ' 4 ' ! ; %VT ; V3 ,r^*^zu$,*^*, N ',V,rV), ' cfw_ 1 $ ' ! ! ' $ ' ! G G'# # G ! ' cfw_ R' ' $ $,uDn,L`"!*!, H; B,L`"!*!)'`" N )VB97 x ; )
Analysis of Algorithms
CS 6033
Heapsort
Thanks: George Bebis
(Chapter 6, Appendix B.5)
Special Types of Trees
Def: Full binary tree = a
binary tree in which each
node is either a leaf or has
degree exactly 2.
Def: Complete binary tree
= a binary tree in
Analysis of Algorithms
Asymptotic Analysis
Thanks: George Bebis
(Chapter 3, Appendix A)
Analysis of Algorithms
An algorithm is a finite set of precise instructions
for performing a computation or for solving a
problem.
What is the goal of analysis of al
CS6033 Design and Analysis of Algorithms
Fall 2013
Homework 5
Assigned date: October 15, 2013.
Due date: October 22, 11:59pm EST, 2013.
Attention:
Done individually.
The homework must be in one PDF file and submitted via Blackboard.
No late submission is
Weighted Graph Algorithms
I
Beyond DFS/BFS exists an alternate universe of algorithms
for edge-weighted graphs.
I
Our adjacency list representation quietly supported these
graphs. (just add a weight field to each node).
Minimum Spanning Trees: Definitions
Foundations of Computer Science - CS 6003
Probabilistic Analysis
and
Randomized Algorithms
NYU:Poly Fall 2013
Hiring Problem
We want to hire an assistant
An agency introduces candidates to us
We get n candidates, one by one
Performance
Types of costs
Analysis of Algorithms
CS 6033
Heapsort
Thanks: George Bebis
(Chapter 6, Appendix B.5)
Special Types of Trees
Def: Full binary tree = a
binary tree in which each
node is either a leaf or has
degree exactly 2.
Def: Complete binary tree
= a binary tree in
Recurrences and Running Time
An equation or inequality that describes a function in
terms of its value on smaller inputs.
T(n) = T(n-1) + n
Recurrences arise when an algorithm contains recursive
calls to itself
What is the actual running time of the al
CS6033 Design and Analysis of Algorithms
Fall 2013
Homework 6
Assigned: October 21, 2013.
Due date: October 29, 11:59PM (EST), 2013.
Attention: Done individually. Solutions will be posted before Quiz 2.
Before doing the homework you should watch the video
Introduction to Algorithms Massachusetts Institute of Technology Professors Erik D. Demaine and Charles E. Leiserson
November 28-December 2, 2005 6.046J/18.410J Quiz 2
Quiz 2
This take-home quiz contains 6 problems worth 25 points each, for a total of 150
Analysis of Algorithms
GRAPHS
Chapter 22
Thanks: George Bebis
But First!
Midterm postmortem
2
The Good
1. [10 PTS] An O(n^2) algorithm is always faster than a O(n^3) algorithm. Is this true or
false? Why?
2. [10 PTS] Give an example of a sorting problem
Foundations of Computer Science - CS 6003
Probability
Chapter 7
NYU:Poly Fall 2013
Some of the figures are from
Discrete Mathematics and Its Applications, 7th Edition, Kenneth H. Rosen
Hash Tables
What is the probability of collision?
Sequential Search
Ru
CS6033 Design and Analysis of Algorithms
Fall 2013
Written Assignment 1
Assigned date: September 4, 2013.
Due date: September 9, 11:59pm EST, 2013.
Attention: Done individually unless specified otherwise. The homework must be in PDF
format and submitted v
Analysis of Algorithms
CS 477/677
Hashing
Thanks: George Bebis
(Chapter 11)
The Search Problem
Find items with keys matching a given search
key
Given an array A, containing n keys, and a
search key x, find the index i such as x=A[i]
As in the case of s
Polytechnic School of Engineering, NYU
CS6033: Design&Analysis of Algs. IFall 2015
JAB474 Mondays 68:30pm
Prof. Boris Aronov (boris.aronov@nyu.edu)
Office: 2MTC 10.008 (718) 260-3092
Office hours: Mondays 35pm and by apt
Course Syllabus
Catalog descriptio
The power of algorithms
In the so-called Flash Crash of 2.45 on May 6 2010, a
five minute dip in the markets caused momentary chaos.
A rogue trader was blamed for the 10% Dow Jones index
fall but in reality
It was the computer program that the unnamed
sequence.
Increasing order of rate of growth:
Theorem 11.6: Given an open-address hash table with load factor = / < 1, the expected
1/n, 1, log(log(n), log(n), , n, nlog(n), ! , !
number of probs in an unsuccessf
CS6033: Design and Analysis Algorithms I
Fall 2010
(1pts) 1. What grade do you expect to get in the course? Circle one.
A A
B+ B B
C+ C F
(1pts) 2. The worst-case running time of MergeSort, in -notation, is
2.
(1pts) 3. Give a mathematical function in (n2
Introduction to Algorithms
6.046J/18.401J LECTURE 14
Competitive Analysis Self-organizing lists Move-to-front heuristic Competitive analysis of MTF
Prof. Charles E. Leiserson
November 2, 2005 Copyright 2001-5 by Erik D. Demaine and Charles E. Leiserson L1
Introduction to Algorithms Massachusetts Institute of Technology Professors Erik D. Demaine and Charles E. Leiserson
October 14, 2005
6.046J/18.410J
Handout 14
Quiz 1 Solutions
Do not open this quiz booklet until you are directed to do so. Read all the
Introduction to Algorithms
6.046J/18.401J LECTURE 18
Shortest Paths II Bellman-Ford algorithm Linear programming and difference constraints VLSI layout compaction
Prof. Erik Demaine
November 16, 2005 Copyright 2001-5 by Erik D. Demaine and Charles E. Leis
Introduction to Algorithms
6.046J/18.401J LECTURE 19
Shortest Paths III All-pairs shortest paths Matrix-multiplication algorithm Floyd-Warshall algorithm Johnson's algorithm Prof. Charles E. Leiserson
November 21, 2005 Copyright 2001-5 by Erik D. Demaine
Introduction to Algorithms Massachusetts Institute of Technology Professors Erik D. Demaine and Charles E. Leiserson
September 30, 2005 6.046J/18.410J Handout 8
Problem Set 1 Solutions
Problem 1-1. Asymptotic Notation For each of the following statements,
Introduction to Algorithms Massachusetts Institute of Technology Professors Erik D. Demaine and Charles E. Leiserson
October 25, 2005
6.046J/18.410J
Handout 17
Lecture Notes on Skip Lists
Lecture 12 October 26, 2005 Erik Demaine
Could you implement the
Introduction to Algorithms
6.046J/18.401J LECTURE 6
Order Statistics Randomized divide and conquer Analysis of expected time Worst-case linear-time order statistics Analysis Prof. Erik Demaine
September 28, 2005 Copyright 2001-5 by Erik D. Demaine and Cha
Introduction to Algorithms Massachusetts Institute of Technology Professors Erik D. Demaine and Charles E. Leiserson
October 7, 2005
6.046J/18.410J
Handout 12
Problem Set 2 Solutions
Problem 2-1. Is this (almost) sorted? Harry Potter, the child wizard o
Introduction to Algorithms Massachusetts Institute of Technology Professors Erik D. Demaine and Charles E. Leiserson
October 29, 2005 6.046J/18.410J Handout 18
Problem Set 4 Solutions
Problem 4-1. Treaps If we insert a set of n items into a binary search
CS6033 Homework Assignment 3
Due Feb. 14th at 5:30 p.m.
Turn in this assignment as a PDF file on NYU classes
No late assignments accepted
1. (15 points) Imagine that you work for an insurance company that is insuring people against
identity theft. You hav