Assignment
1/28/15, 10:48 PM
CSE310 Assignment 1
Due Date
Friday, January 16th, 5:30pm, 2015
Important: This is an individual assignment. Please do not collaborate.
No late assignment will be accepted.
Make sure that you write every line of your code. Usi
CSE310 Assignment3
Due: Friday, February 6th, 5:30pm
On-line submission, No late assignment will be accepted
Important: This is an individual assignment. Please do not collaborate.
1. (4 pts) Suppose that T(n) = T(n/8) + T(7n/8) +5n. Prove that T(n) = (n
Review List for Midterm
Contents and Requirements
Contents
Requirements
Midterm 1, 09/30/2013
CLOSED BOOK
What to bring:
ASU ID
Calculator
What NOT to bring:
Cell phone (should be turned off during
Cell
exam)
exam)
Laptop
Notes/Books
Analysis of Alg
Spring 2010 CSE310 Midterm Examination 01A (in class) Instructions:
There are ve problems in this paper. Please use the space provided (below the questions) to write the answers. Budget your time to solve various problems (roughly 15 minutes for each pro
Spring 2010 CSE310 Midterm Examination 01B (in class) Instructions:
There are ve problems in this paper. Please use the space provided (below the questions) to write the answers. Budget your time to solve various problems (roughly 15 minutes for each pro
CSE310 HW01 Grading Keys
1. (10 pts) Let f (n) = n2 and g(n) = 100 n log2 n. Find the smallest integer N 0 such that f (N ) g(N ) but f (N + 1) > g(N + 1). Show the values of N , f (N ), g(N ), f (N + 1) and g(N + 1). Solutions: How to obtain the
CSE310 HW01 Grading Keys
A Please note that you have to typeset your assignment using either L TEX or Microsoft Word. Hand-written assignment will not be graded. You need to submit a hardcopy before the lecture on the due date. You also need to submit an
CSE310 HW03, Thursday, 02/18/2010, Due: Thursday, 02/25/2010
A Please note that you have to typeset your assignment using either L TEX or Microsoft Word. Hand-written assignment will not be graded. You need to submit a hardcopy before the lecture on the d
CSE310 HW06, Thursday, 04/22/2010, Due: Thursday, 04/29/2010
A Please note that you have to typeset your assignment using either L TEX or Microsoft Word. Hand-written assignment will not be graded. You need to submit a hardcopy before the lecture on the d
CSE310 HW03, Monday, 10/21/2013, Due: Monday, 10/28/2013
A
Please note that you have to typeset your assignment using either L TEX or Microsoft
Word. Hand-written assignment will not be graded. You need to submit a hardcopy
before the lecture on the due d
CSE310 HW04 Grading Keys
A
Please note that you have to typeset your assignment using either L TEX or Microsoft
Word. Hand-written assignment will not be graded. You need to submit a hardcopy
before the lecture on the due date. You also need to submit an
CSE310 Lecture01:
Algorithms, Counting and Data Structures
Guoliang (Larry) Xue
Department of CSE
Arizona State University
http:/optimization.asu.edu/~xue
Guoliang.Xue@asu.edu
Topics of this lecture
Discussion of Syllabus
Algorithms
Counting and Induction
CSE310 Lecture02:
The Computing Model and Asymptotic Notations
Guoliang (Larry) Xue
Department of CSE
Arizona State University
http:/optimization.asu.edu/~xue
Guoliang.Xue@asu.edu
Topics of this lecture
The RAM
constant access of memory
constant time for
CSE310 Lecture 27:
Overall Review
Guoliang (Larry) Xue
Department of CSE
Arizona State University
http:/www.fulton.asu.edu/~xue
Guoliang.Xue@asu.edu
Final Exam Logistics
110 minutes, Closed Book/Notes
You are allowed one letter-sized cheat sheet
No elec
CSE310 Lectures 03-04:
Recurrences And the Master Method
Guoliang (Larry) Xue
Department of CSE
Arizona State University
http:/optimization.asu.edu/~xue
Guoliang.Xue@asu.edu
Topics of this lecture
Recurrences
General form of recurrence
1st example: block
CSE310 Lecture 05:
Insertion Sort and Operations Count
Guoliang (Larry) Xue
Department of CSE
Arizona State University
http:/optimization.asu.edu/~xue
Guoliang.Xue@asu.edu
Topics of this lecture
Sorting
The problem
Algorithms
Insertion Sort
Description
CSE310 Lecture 06:
Quick-Sort
Guoliang (Larry) Xue
Department of CSE
Arizona State University
http:/optimization.asu.edu/~xue
Guoliang.Xue@asu.edu
Topics of this lecture
Divide and Conquer
Divide
Conquer
Combine
Quick Sort
Description
Example
Worst-ca
CSE310 Lecture 07:
Mergesort
Guoliang (Larry) Xue
Department of CSE
Arizona State University
http:/optimization.asu.edu/~xue
Guoliang.Xue@asu.edu
Topics of this lecture
Merge and Mergesort
Merging in linear time
Mergesort
Worst-case analysis
Best-case
CSE310 Examples for Using the Master Method
1. Exercise 4.5-1.a (page 96).
Solution. a = 2, b = 4, f (n) = 1. logb a = log4 2 = 0.5. For = 0.2, we have f (n)
O(n(logb a) ). Therefore we have case-1. According to the master method, we conclude that
T (n)
CSE310 HW04, Monday, 11/25/2013, Due: Monday, 12/02/2013
A
Please note that you have to typeset your assignment using either L TEX or Microsoft
Word. Hand-written assignment will not be graded. You need to submit a hardcopy
before the lecture on the due d
CSE310 Examples for Using the Master Method
1. Exercise 4.5-1.a (page 96).
Solution. a = 2, b = 4, f (n) = 1. logb a = log4 2 = 0.5. For = 0.2, we have f (n)
O(n(logb a) ). Therefore we have case-1. According to the master method, we conclude that
T (n)
CSE310 Examples for Proving Asymptotic Notations
1. Let f (n) =
n
2
i=1 i , n
Proof. f (n) =
= 1, 2, . . . Then f (n) (n3 ).
n(n+1)(2n+1)
.
6
Hence
lim
n
Let c1 =
1
6
f (n)
n(n + 1)(2n + 1)
1
= nlim
=.
3
3
n
6n
3
and c2 = 1. Since
c1 <
1
< c2 ,
3
there ex
CSE310 Examples for Proving Asymptotic Notations
1. Let f (n) =
n
2
i=1 i , n
Proof. f (n) =
= 1, 2, . . . Then f (n) (n3 ).
n(n+1)(2n+1)
.
6
Hence
lim
n
Let c1 =
1
6
f (n)
n(n + 1)(2n + 1)
1
= nlim
=.
3
3
n
6n
3
and c2 = 1. Since
c1 <
1
< c2 ,
3
there ex
Review List for Midterm
Contents and Requirements
Contents
Requirements
Midterm 1, 09/30/2013
CLOSED BOOK
What to bring:
ASU ID
Calculator
What NOT to bring:
Cell phone (should be turned off during
Cell
exam)
exam)
Laptop
Notes/Books
Analysis of Alg
Graph Traversal and Topological Sort
09/28/13
BFS
DFS
Topological Sort
1
Breadth-First Search on Graphs
The purposes of breadth-first search are
traversing all nodes in the graph
calculating the minimum hop path from the
source node to all other nodes
The
= Data Structures for Disjoint Sets =
some applications involve grouping n distinct elements into a
collection of disjoint sets. Two important operations are
FIND: finding which set an element belongs to
UNION: uniting two sets
disjoint set data structu
CSE310 HW03, Monday, 10/21/2013, Due: Monday, 10/28/2013
A
Please note that you have to typeset your assignment using either L TEX or Microsoft
Word. Hand-written assignment will not be graded. You need to submit a hardcopy
before the lecture on the due d
Graphs and Graph Algorithms
Graphs are a pervasive data structure. Trees are a
special form of graphsconnected and without
a cycle.
Graph Representations
adjacency matrix
adjacency list
list of edges
Graph Algorithms:
Searching a graph using BFS and DFS
M