Quiz 1
Total Time: 30 minutes Total Points: 15
Problem #1 (2 points)
Explain why the phrase at least O(n2) is meaningless.
A description of a function in terms of O-notation provides an upper bound on the growth rate
of the function. If an algorithm is O(
CS 180, Spring 2014 Homework 5
1. Were asked to help the captain of the UCLA tennis team to arrange a series of matches against USCs
team. Both teams have n players; the tennis rating (a positive number, where a higher number can
be interpreted to mean a
CS 180, Spring 2014 Homework 5 (Solution Outlines)
1. Were asked to help the captain of the UCLA tennis team to arrange a series of matches against USCs
team. Both teams have n players; the tennis rating (a positive number, where a higher number can
be in
CS180 Introduction to Algorithms
University of California, Los Angeles
Assigned on June 27th, 2012
Due on July 6th, 2012
Homework #1
(Please refer to the homework policy section on the syllabus)
Problem #1 (Exercise 2.1 - 2)
Rewrite the Insertion-Sort alg
CS 180, Spring 2014 Homework 4 Solution Outlines
1. When their respective sport is not in season, UCLAs student-athletes are very involved in their community, helping people and spreading goodwill for the school. Unfortunately, NCAA1 regulations limit
eac
CS 180, Fall 2015 Homework 8
The following homework is due on Wednesday, December 2nd at the beginning of lecture.
When submitting your homework, please include your name at the top of each page. If you submit multiple
pages, please staple them together.
CS 180, Summer 2014 Homework 4 Solution Outlines
1. Suppose wed like to acquire a set of n useful programs. Each program is sold by two companies, and the
two versions are potentially of dierent quality. Suppose that company ones version of program i has
CS180 Winter 2011
Homework 3 The following homework is due Wednesday, January 26 at the beginning of lecture. When submitting your homework, please include your name at the top of each page. If you submit multiple pages, please staple them together. We al
CS 180, Spring 2014 Homework 1 Solutions
0. Read and understand the homework submission and collaboration policy in the syllabus, as well as
the academic honesty policy. Despite being listed as item 0 on your rst homework, this is very
important! If you a
Mid-term. February 3, 2017
CS180: Algorithms and Complexity
Winter 2017
Guidelines:
The exam is closed book and closed notes. Do not open the exam until instructed to do so.
Write your solutions clearly and when asked to do so, provide complete proofs.
CS 180, Summer 2014 Homework 1 Solution Outlines
1. Suppose youre helping to organize a summer sports camp, and the following problem comes up. The
camp is supposed to have at least one counselor who is skilled at each of the n sports covered by the
camp.
Sample Final Exam Questions
The cover page will have the same rules of the exam. The question pages will begin with some multiple
choice questions, similar to past exams. You will then have a short answer question; heres a sample one:
Short Answer
Give a
Assignment 3. Due April 29
CS180: Algorithms and Complexity
Guidelines for submitting the solutions:
It is strongly recommended to use LATEXor other word processing software for submitting the
homework. This is not mandatory but will be helpful both for
NAME and UID:
!
CS180 Algorithms and Complexity
Winter 2015
D.S. Parker, Yuh-Jie Chen, Xiaoran Xu
Sample Final Examination
OPEN BOOK, OPEN NOTES
Tuesday, March 17, 11:001:50pm
1. Dynamic Programming #1
Grid Amusement Park looks like a 5x5 grid, with 40 ri
CS 180: Algorithms and Complexity
University of California, Los Angeles
Summer 13
Homework # 1
Due Date: Wed. July 3rd (In Class) LATE HOMEWORK WILL NOT BE ACCEPTED
Please write very clearly and succinctly (consider typing your homework),
Overly long home
CS180 Winter 2011 Due: 2nd March
Homework 7
When submitting your homework, please include your name at the top of each page. If you submit multiple pages, please staple them together. We also ask that you do something to indicate which name is your last n
CS 180: Algorithms and Complexity
University of California, Los Angeles
Summer 13
Homework # 2
Due Date: Wed. July 10th (In Class) LATE HOMEWORK WILL NOT BE ACCEPTED
Please write very clearly and succinctly (consider typing your homework),
Overly long hom
CS 180, Homework 1 Solutions
1. In class, we discussed the game of Nim. This game begins with a placement of n rows of matches on
a table. Each row i has mi matches. Players take turns selecting a row of matches and removing any
or all of the matches in t
Assignment 5. Due June 1
CS180: Algorithms and Complexity
Spring 2015
Guidelines for submitting the solutions:
It is strongly recommended to use LATEX or other word processing software for submitting the
homework. This is not mandatory but will be helpfu
CS 180, Fall 2015 Solution 7
The following homework is due on Wednesday, November 25th at the beginning of lecture.
When submitting your homework, please include your name at the top of each page. If you submit multiple
pages, please staple them together.
CS 180 Winter 2014
Homework 6
(2 pages)
The following homework is due Wednesday, February 19 at the beginning of lecture. You may
also turn in this assignment to the CS 180 drop box in 2432 Boelter Hall by 9:30 AM. Use of the
homework drop box is at your
uynarmc Prograrmrung PracUce t'roblems
Dynamic Programming Practice Problems
Problems:
j
>.
1 of 1
Subsequence. Given a sequence of n real numbers A(1) . A(n), determine a contiguous
1. Maximum Value Conti !lUllLL<;
subsequence A(i) . AU) for which the su
CS 180, Fall 2015 Homework 8
The following homework is due on Wednesday, December 2nd at the beginning of lecture.
When submitting your homework, please include your name at the top of each page. If you submit multiple
pages, please staple them together.
CS180 Winter 2011
Homework 1 The following homework is due Wednesday, January 12 at the beginning of lecture. When submitting your homework, please include your name at the top of each page. If you submit multiple pages, please staple them together. We al
CS 180 Winter 2014
Homework 9
(3 pages)
The following homework is due Wednesday, March 12 at the beginning of lecture. You may also
turn in this assignment to the CS 180 drop box in 2432 Boelter Hall by 9:30 AM. Use of the
homework drop box is at your own
CS 180, Spring 2014 Homework 6
Problems 1 and 2 deal with divide and conquer; problems 3 and 4 deal with network ow, which we will
begin discussing on May 22. To avoid having a lot of homework all at once, I suggest solving problems 1
and 2 before May 22,
Sample Final Exam Questions
Short Answer
Give a brief answer to the following question; your answer to each should be no more than a few sentences.
1. In lecture, we saw that the Ford-Fulkerson algorithm (and the -scaling variant) work on ow networks
with
Week 10 Discussion: NP-Completeness II
CS 180 Spring 2014
Hints are given on the second page for some of the problems.
1. Consider the problem of Partial-TSP: We are given a set of n cities along with metric
distances between them. Were asked to determine
Karen Zhang
Sportiche
Linguistics 1
2 December 2016
Linguistics Term Paper
(0) Like many other children of first generation Chinese immigrants, I rarely spoke
English in my house. My parents immigrated to the States in the early 1980s, and even though
the
CS180 HW4
NAME: WANYI ZHANG UID: 804761704
3.
(a)
We can easily find an example:
if we have (v1,v2) (v2,v5) (v1,v3) (v3,v4) (v4,v5)
the algorithm will choose: (v1,v2) (v2,v5)
but the optimal is: (v1,v3) (v3,v4) (v4,v5)
(b)
We can use the dynamic programmi
CS180 HW1
NAME: WANYI ZHANG UID: 804761704
5.
(a) False.
We have:
f (n) = O(g(n) ;
so for any n0 , when n n0 , f (n) C 1 g(n) ,
so:
log 2 f (n) log 2 (C 1 g(n)
log 2 f (n) log 2 C 1 + log 2 g(n) is true.
Then if: log 2 f (n) is O(log 2 g(n) , for any n0 ,
CS180 Homework 2
Due: 8:00pm, 4/20/2017
Problems 15, 22 and 36 from Chapter 8 in Algorithm Design (the first edition)
Homework assignments are due on the exact time indicated. Please submit your homework using
the Gradescope system. Email attachments or
CS180 HW4
NAME: WANYI ZHANG UID: 804761704
22.
NO.
As shown in the following graph, graph (c) is a spanning tree and all the minimum spanning
tree will have similar structure like (b), so all the edges in (c) also in the minimum spanning
trees, so we find