Fall Quarter, 2017

instructor: | Stefano Lonardi, office hours: Friday 10am-11pm; WCH 325; email: stelo@ucr.edu |

teaching assistant: | Dipankar Ranjan Baisya, office hours: Tuesday 3-5pm; WCH 110; email:dipankar.baisya@email.ucr.edu |

prerequisites: | CS 014 with a grade of "C-" or better, calculus, CS/MATH 111 |

lecture: | MWF 1:10pm-2pm, Bourns Hall A125 |

final exam: | Tuesday, December 12, 7-10pm |

textbook: | Algorithms by Dasgupta et al. |

Chapters 0, 2-6 of the textbook, plus some additional materials covered in the slides.

Mondays (except the first week) you will have a homework due.

Nine written homework assignments, due every Monday. Homework papers should be prepared in LaTeX or some other word-processing system that can handle equations (figures can be hand-drawn), then converted/scanned to pdf format and turned in via Gradescope.

Attendance in discussions sections is strongly encouraged, but not mandatory.

The point of the homework is to help learn the material by doing, and to get feedback on the correctness of your ideas and the clarity of your written communication. In this spirit, it's fine to ask for, and provide, useful ideas and pointers to help yourself and others. But please do not ask for or provide complete solutions. Collaborate in the spirit of helping everyone to learn fully, so that all will do well on the quizzes and exams.

All work that you submit must be fully authored by you. That is, you must write your own homework. If you incorporate ideas from another source, you must appropriately cite the source.

*Each student's work should be fully authored by his or her self, in his or her own words - that is, each student should turn in only text authored by his or her self. Each student is responsible for understanding all text that they submit. Finally, in each turned-in work, each student should appropriately cite any help or ideas that came from any other source.* Violation of this policy is plagiarism and will be referred to the UCR student conduct office.

Quiz1 20%, Quiz2 20%, Final 40%, Homework 20%. The homework with the lowest score (out of 9) will be dropped form the average. Course grades are expected to be determined roughly as follows: A = 80-100%, B = 70-80%, C = 60-70%, D = 55-60%. Minor adjustments of this scale may be made during the quarter.

Grading is an approximate process, intended primarily to give you feedback about your work. Grading mistakes are always possible. Please check your graded work to find out what you missed, and for grading mistakes, when the work is returned to you. If you find a mistake, please contact the TA or the instructor within 1 week. Requests for regrading later than 1 week after receipt of the graded material won't be considered unless they have cost you many many points.

Per university policy, changes to your final grade will be made **only** in the event of a clerical error. Asking your instructor how far you were from a cutoff and what extra work you can do to improve the grade is not appropriate.

Unless explicitly noted, assignments cannot be turned in past their deadlines, and missed exams cannot be made up. Exceptions may be made under extreme (and documented) circumstances. If you anticipate missing an assignment deadline, a quiz, or the final, contact the instructor as soon as possible before the deadline.

- O-notation
- worst-case analysis of running times
- polynomial running time versus exponential running time

- Sub-quadratic-time algorithm for large-integer multiplication
- Recurrence relations, recursion trees
- Counting the time per level in a recursion tree
- Bounding sums - Geometric sums, naive upper and lower bounds
- Mergesort, multiplication, median finding, closest pair, majority finding

- Graphs, DFS (depth-first search)
- Finding cycles in undirected and directed graphs
- Linearization of a DAG (directed acyclic graph)

- BFS. Dijkstra's algorithm
- Shortest paths in DAGs
- Negative weights (Bellman-Ford algorithm)

- Counting paths in a DAG. Shortest/longest paths in a DAG
- Longest increasing subsequence
- Edit distance
- Longest palindromic subsequence
- Optimal paragraph formatting
- Breaking a string into word
- DNA edit distance

- Making change with denominations {1,5,10,25}
- Minimum spanning trees (Kruskal's and Prim's algorithms)
- Huffman coding