









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










Designing algorithms (recipes) to solve problems. Proving that an algorithm correctly solves a problem. Analyzing the resources (time, space) required by analgorithm. Exploring techniques for algorithm design and analysis
divide/conquer/glue and recurrence equations induction and loop invariants greediness dynamic programming probabilistic algorithms and analyses amortized analysis Learning standard algorithms in a variety of domains.
Idea:
Scan
from left to right. For each non-matching pair,
swap 2nd element of pair with match for 1st element foundby scanning rightward. CLRS-style Psuedo-code:
1
match(A) 2
for
i
1
to^
(length[A]/2)
do
3
if^
A[2i-1]