CS161 Homework 4
Submit on Gradescope
Due: 13 May 2016
Handed out: 6 May 2016
Instructions: Please answer the following questions to the best of your ability. If you are asked to design
an algorithm, please describe it clearly and concisely, prove its cor
CS161: Design and Analysis of Algorithms
Summer 2004
Problem Set #2 Solutions
General Notes
Regrade Policy: If you believe an error has been made in the grading of your problem
set, you may resubmit it for a regrade. If the error consists of more than an
CS161: Design and Analysis of Algorithms
Summer 2004
Problem Set #6 Solutions
General Notes
Regrade Policy: If you believe an error has been made in the grading of your problem
set, you may resubmit it for a regrade. If the error consists of more than an
CS161: Design and Analysis of Algorithms
Summer 2004
Problem Set #3 Solutions
General Notes
Regrade Policy: If you believe an error has been made in the grading of your problem set, you may resubmit it for a regrade. If the error consists of more than an
Recurrences, Divide and Conquer
October 7, 2014
Homework 2
Due Date: Tuesday, 14 October 2014 by end of lecture.
Whenever we ask you to design an algorithm, we always want to see three things: a description of the algorithm,
a run-time analysis, and an e
Problem Set 5: Randomized Algorithms and Hashing
Due August 1st at noon.
Instructions:
Same as before.
Problem 1. (6 points, 2 for each part) KT 13.7
7
In section 13.4, we designed an approximation algorithm to within a factor of 8 for the
MAX 3-SAT Prob
Problem Set 3: Greedy Algorithms, Minimum Spanning Trees
Due July 18th at noon.
Instructions:
Whenever we ask you to design an algorithm, we always want to see three things:
(1) Description of the algorithm; (2) an explanation/proof that the algorithm do
Problem Set 1: Big-oh Notation, Recurrences,
Divide-and-Conquer Algorithms
Due July 4th at noon.
Instructions:
Whenever we ask you to design an algorithm, we always want to see three things:
(1) Description of the algorithm; (2) an explanation/proof that
Problem Set 6: Dynamic Programming, Approximation
Algorithms
Due August 13th at midnight.
Instructions:
Same as before.
Problem 1. (5 points) KT 6.8
The residents of the underground city of Zion defend themselves through a combination
of kung fu, heavy a
CS161: Design and Analysis of Algorithms
Summer 2004
Problem Set #5 Solutions
General Notes
Regrade Policy: If you believe an error has been made in the grading of your problem
set, you may resubmit it for a regrade. If the error consists of more than an
CS161: Algorithm Design and Analysis
Stanford University
Homework #4:
Due Date:
Handout # 5
Wednesday, 2 May 2012
Sorting models, hashing
Wednesday, 9 May 2012
Problem 1. Real Cost of Sorting. [40 points, 8 points per part]
As part of a homework assignmen
CS161: Algorithm Design and Analysis
Stanford University
Homework #2:
Due Date:
Handout # 2
Wednesday, 18 April 2012
Divide-and-Conquer Algorithms, Recurrence Relations
Wednesday, 25 April 2012
Homework policies
For the complete set of homework policies i
CS161: Design and Analysis of Algorithms
Summer 2004
Problem Set #4 Solutions
General Notes
Regrade Policy: If you believe an error has been made in the grading of your problem
set, you may resubmit it for a regrade. If the error consists of more than an
Getting The Sample Executables
Before you start coding, you should make a local copy of my own solution, which is a set of
executables that comprise a fully operational MapReduce system. You can do so by typing in:
myth22:~> cp -r /usr/class/cs110/samples
Lecture 18, Dec 4 2014
Termination
We can terminate at phase k if, for all v, dk(v) = dk-1(v) ,
since no more changes will happen in dk(v) for larger values of k.
Terminates in n-1 phases if no negative cycles
(might terminate earlier)
Proof in the textb
Greedy, DFS/BFS, MST
November 13, 2014
Homework 5
Due Date: Thursday, November 20, 2013, 12:15pm Pacic.
Whenever we ask you to design an algorithm, we always want to see three things: a description of the
algorithm, a run-time analysis, and an explanatio
Sorting, Hashing, Binary Search Trees
November 4, 2014
Homework 4
Due Date: Thursday, 6 November 2014 by end of lecture
Whenever we ask you to design an algorithm, we always want to see three things: a description of the
algorithm, a run-time analysis, a
CS161
Fall 2014
Homework Advice for Algorithms
Based on a handout by Tim Roughgarden, with edits by Keith Schwarz and Sophia Westwood
This handout contains information about the homework sets for CS161 how to approach them,
what we're looking for when gra
Selection, Heaps
October 16, 2014
Homework 3
Due Date: Thursday, 23 October 2014 by end of lecture
Whenever we ask you to design an algorithm, we always want to see three things: a description of the
algorithm, a run-time analysis, and an explanation/pro
MST, Shortest Paths, Dynamic Programming
November 21, 2014
Homework 6
Due Date: No due date, the assignment is optional and should not be submitted.
You are welcome to come to oce hours to discuss solutions.
Solutions will be distributed only at the last
CS161, Lecture 2
Scribe: Michael P. Kim
1
MergeSort, Recurrences, Asymptotic Analysis
Date: April 1, 2015
Introduction
Today, we will introduce a fundamental algorithm design paradigm, Divide-And-Conquer, through a case
study of the MergeSort algorithm. A
CS161, Lecture 4
Median, Selection, and the Substitution Method
Scribe: Albert Chen and Juliana Cook (2015), Sam Kim (2016), Gregory Valiant (2017) Date:
January 23, 2017
1
Introduction
Last lecture, we covered the master theorem,
which can be used for r
CS161 Homework 0
Submit on Scoryst
Due: 10 April 2015, 12 noon
Handed out: 3 April 2015
Instructions: Please answer the following questions to the best of your ability. If you are asked to show
your work, please include relevant calculations for deriving
CS161 Homework 3
Submit on Scoryst
Due: 1 May 2015
Handed out: 24 April 2015
Instructions: Please answer the following questions to the best of your ability. If you are asked to show
your work, please include relevant calculations for deriving your answer
CS161 Homework 2
Submit on Scoryst
Due: 24 April 2015
Handed out: 17 April 2015
Instructions: Please answer the following questions to the best of your ability. If you are asked to show
your work, please include relevant calculations for deriving your ans
CS161 Homework 5 Dynamic Programming and Greedy Algorithms
Due: 22 May 2015
Submit on Scoryst
Handed out: 15 May 2015
Instructions: Please answer the following questions to the best of your ability. If you are asked to show
your work, please include relev
CS161 Homework 4
Submit on Scoryst
Due: 15 May 2015
Handed out: 8 May 2015
Instructions: Please answer the following questions to the best of your ability. If you are asked to show
your work, please include relevant calculations for deriving your answer.
CS161 Homework 0
Submit on Scoryst
Due: 10 April 2015, 12 noon
Handed out: 3 April 2015
Instructions: Please answer the following questions to the best of your ability. If you are asked to show
your work, please include relevant calculations for deriving
CS161 Lecture 7
Scribes: Ilan Goodman, Vishnu Sundaresan (2015),
Virginia Williams (2016), and Wilbur Yang (2016), G. Valiant
1
Binary Search Trees
Date: February 1, 2017
Data Structures
Thus far in this course we have mainly discussed algorithm design, a
Lecture 11
Dijkstras Algorithm, Amortized Analysis, Bellman-Ford Algorithm
Scribes: Himanshu Bhandoh (2015), Virginia Williams, and
Date: February 15, 2017
Anthony Kim (2016)m G. Valiant (2017)
1
Dijkstras Algorithm
Now we will solve the single source sho
CS 161, Lecture 1
Scribes: V.V. Williams, J. Su (2015), W. Yang, G. Valiant
Introduction
Date: January 9, 2017
Optional reading for this lecture: Kleinberg-Tardos: p. 278-280 Sec 5.5, 6.9
1
Course information
The class website is http:/cs161.stanford.edu
CS 161, Lecture 5
Scribe: Sam Keller (2015), Seth Hildick-Smith (2016), G. Valiant (2017)
2017
1
Quicksort
Date: January 25,
Introduction
Today well study another sorting algorithm. Quicksort was invented in 1959 by Tony Hoare. You may
wonder why we want
CS161 notes
lecture1
Why algorithms?
1. Fundamental, core of CS
2. Algorithms is useful
3. This course is fun
Two applications
Internet routing
Internet as a graph with nodes and vertices. We want to take the shortest path.
BFS, Dijkstra's can be used. B