Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

CS170 Midterm 1 Exam, Fall 2006, Papadimitriou/Vazirani, Exams of Algorithms and Programming

A midterm exam for the cs170 course, fall 2006, taught by papadimitriou and vazirani. The exam covers various topics in computer science, including number theory, recursion, graph theory, and polynomial multiplication using the fast fourier transform. Students are required to be clear and concise in their answers, and the exam consists of short questions and a programming problem.

Typology: Exams

2012/2013

Uploaded on 04/02/2013

sushmi_98
sushmi_98 🇮🇳

4.5

(4)

52 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS170, Fall 2006, Midterm 1, Papadimitriou/Vazirani
NAME: _____________________________
TA: ________________________________
CS170 Midterm 1 October 4, 2006
Be clear and concise.
Total number of points is 50. So, you may use the number of points assigned to
each problem as a rough estimate for the number of minutes you might allocate to
the problem.
Use the back pages as scratch paper.
1
2
3
total
pf3
pf4

Partial preview of the text

Download CS170 Midterm 1 Exam, Fall 2006, Papadimitriou/Vazirani and more Exams Algorithms and Programming in PDF only on Docsity!

CS170, Fall 2006, Midterm 1, Papadimitriou/Vazirani

NAME: _____________________________

TA: ________________________________

CS170 Midterm 1 October 4, 2006

  • Be clear and concise.
  • Total number of points is 50. So, you may use the number of points assigned to each problem as a rough estimate for the number of minutes you might allocate to the problem.
  • Use the back pages as scratch paper.

1

total

  1. ((20 points) Short questions)
    • How many numbers x are there between 1 and 90 such that x mod 5 = 1 and x mod 3 = 2?
    • What is 3^800 mod 15?
    • In RSA, p = 7, q = 13, e = 5. Why is e = 5 an appropriate choice?
    • What is the solution of T(n) = T(n/2) + 1, T( 1 ) = 0?
    • True or False? Explain very briefly: If ω is the nth^ root of 1, then for any k ≤ n
    • You wish to multiply the polynomials x^2 + 2 and x^3 + x – 1 using the FFT. At which points will you evaluate these polynomials? Write any complex numbers in your answer as a + ib.
  1. (20 points)
    • Perform depth-first search on this directed graph. Give the Previsit and Postvisit numbers of the nodes. Process nodes in alphabetical order (node A is visited first, and edge AB is visited before AD).
    • A vista vertex of a directed graph is a vertex from which all other vertices are reachable. Does the graph above contain a vista vertex?
    • True or False? (Explain briefly): If a graph has a vista vertex, it will be the last vertex from which explore is called in the main loop of depth-first search.
    • Give a linear-time algorithm for telling if a graph has a vista vertex. Briefly justify its correctness. Why is it linear?