



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Main points of this exam paper are: Theoretical Algorithms, Number Theoretical, Asymptotic Upper, Upper Bound, Encoding, Algorithm Design, Sorted Arrays, Fft Matrix, Depth Rst Search, Starting Point
Typology: Exams
1 / 6
This page cannot be seen from the preview
Don't miss anything!




UC Berkeley—CS 170 Midterm 1 Lecturer: Satish Rao March 10
Print your name:
(last) (first)
Sign your name:
Write your section number (e.g., 101):
Write your SID:
One page of notes is permitted. No electronic devices, e.g. cell phones and calculators, are permitted. Do all your work on the pages of this examination. If you need more space, you may use the reverse side of the page, but try to use the reverse of the same page where the problem is stated.
You have 80 minutes. The questions are of varying difficulty, so avoid spending too long on any one question.
In all algorithm design problems, you may use high-level pseudocode.
DO NOT TURN THE PAGE UNTIL YOU ARE TOLD TO DO SO.
Problem Score/Points Name/Section/etc. / 1 / 2 / 3 / 4 / 5 / Total /
Answer true or false for each. Scoring is 2 points for correct answer and -2 points for incorrect.
√n = Θ(
n).
If f (n) = O(g(n)), then g(n) = Ω(f (n)).
∑n j=1 j^ =^ O(n^ log^ n).
Given only the ability to run DFS on a graph from any starting point u and obtaining the resulting pre and post order numbers. (You never get to see an edge.) (Remark: these are pretty easy so don’t worry if it seems so.)