Professional Documents
Culture Documents
declare that I will not be involved in any kind of cheating/copying/plagiarizing in solving the
assignment based paper of Mid Term Examination 2020. I take full responsibility of my
then Institute reserves the right to take any disciplinary action against me.
Student Signature
Mid Exam / Spring 2020 (Paper Duration 24 hours)
To be filled by Student
Q.No.1. (Marks 4)
Using big-oh notation, give the running time of the following piece of code. Briefly justify
your answer.
for (i = 1; i <= n; i++)
for (j = 1; j <= n/2; j++)
for (k = 1; k <= j; k++)
cout << "hello world\n";
Q.No.2 (marks 8)
Recall the 2-D Maxima Problem that we have discussed in class. Develop a scenario just like
discuss in class but don’t take the same example (build a new example to demonstrate the
2-D Maxima problem ) also example the worst case analysis of 2-D Maxima in detail
Q.No. 3
If you are working in an organization and you are asked to sort data having one million
values and you want to find out the results as soon as possible. Which sorry algorithm will
you prefer among you know and why if you choose any algorithm to sort the data you have
to justify its best performance by showing its time complexity (Mathematical proof)
(marks.. 6)