Problems on Algorithms
Second Edition
Ian Parberry and William Gasarch
July 2002
Consisting of
Problems on Algorithms, First Edition, by Ian
Parberry, formerly published in 1994 by PrenticeHall, Inc.
Errata to the First Edition, published in 1998.
Supplem
Analysis of Algorithms
Mid Exam
Instructor: Fahad Javed
Max Marks: 100
NOTE: Following is the template for the final exam. Any 4 questions from basic 2 from
intermediate and 2 from advance will be given in the final exam.
Basic: 50
Intermediate: 20
Advanc
Analysis of Algorithms
Assignment 1
Posting Date: 30 Oct
Instructor: Fahad Javed
Max Marks: 100
Due Date 9 Nov
This is an individual assignment. You are required to submit the code and the output of the
assignment in printed form.
Question1: Let n = inver
Analysis of Algorithms
Final Exam
Instructor: Fahad Javed
Max Marks: 100
NOTE: Following is the template for the final exam. Any 4 questions from basic 2 from
intermediate and 2 from advance will be given in the final exam.
Basic: 50
Intermediate: 20
Adva
Analysis of Algorithms
Quiz 4 (a)
Instructor: Fahad Javed
Max Marks: 10
Name:
Student id:
Q1.
You are given following list of numbers
87654321
a. Using the policy that first element is the pivot sort the list using quick sort. Show the
steps of division a
Analysis of Algorithms
Quiz 5
Instructor: Fahad Javed
Max Marks: 10
Name:
Student id:
Q1.
What will be the output of the following code (let n = 500)? What will be its time
complexity in terms of n, how many times will the inner loop run and what will the
Analysis of Algorithms
Quiz 1
Instructor: Fahad Javed
Max Marks: 10
Name:
Student id:
Q1.
What will be the output of the following code (let n = 50)? What will be its time
complexity in terms of number times the code will print a number?
a.
sum = 0;
for(j
Analysis of Algorithms
Quiz 0
Instructor: Fahad Javed
Max Marks: 10
Q1.
Write code, pseudo-code or draw flow chart which can report if a given number K is
present in the provided list list of numbers.
Q2.
Write code, pseudo-code or draw flow chart which c
Max time: 10 minutes
Analysis of Algorithm Spring 2014
Quiz 3 (i)
Max marks: 10
On the GT road between Lahore and Islamabad there are 18 towns.
1. We would like to find the pair of cities which have the longest distance between two neighboring
cities.
a.
Max time: 10 minutes
Analysis of Algorithm Spring 2014
Quiz 2 (i)
Max marks: 10
In the class we discussed recursive division of report cards on basis of roll number digits. We divided the
report cards with most significant digit greater than 4 in one pile