Professional Documents
Culture Documents
Assessment Questions 1 Final Year
Assessment Questions 1 Final Year
3. What is the worst-case running times of Insertion sort, Merge sort, and Quicksort?
4. What is the number of swaps required to sort n elements using selection sort in the
worst case?
5. Suppose we want to arrange the n numbers stored in an array such that all negative
values occur before all positive ones. What will be the minimum number of
exchanges required in the worst case?
6. Assume that a merge sort algorithm in the worst case takes 30 seconds for an input of
size 64. Which of the following most closely approximates the maximum input size of
a problem that can be solved in 6 minutes?
int main()
{
int n = 8;
print(n, 1);
}
9. Suppose there are 11 items in sorted order in an array. How many searches are
required on the average, if binary search is employed and all searches are successful
in finding the item?
10. Consider a sorted array of n numbers and a number x. What would be the time
complexity of the best known algorithm to find a triplet with sum equal to x. For
example, arr[] = {1, 5, 10, 15, 20, 30}, x = 40. Then there is a triplet {5, 15, 20} with
sum 40.
a. 15
b. 18
c. 21
d. 12
2. MAC + MAAR = JOCKO, find the value of 3A + 2M + 2C.
a. 31
b. 36
c. 33
d. 38
3. Odometer is to mileage as compass is to
a. speed
b. hiking
c. needle
d. direction
4. Statement: "You are hereby appointed as a programmer with a probation period of one
year and your performance will be reviewed at the end of the period for confirmation." - A
line in an appointment letter.
Assumptions:
I. The performance of an individual generally is not known at the time of appointment
offer.
II. Generally an individual tries to prove his worth in the probation period.
a. Only assumption I is implicit
b. Only assumption II is implicit
c. Either I or II is implicit
d. Neither I nor II is implicit
e. Both I and II are implicit
5. Which of the following numbers must be added to 5678 to give a remainder 35 when
divided by 460?
a. 980
b. 618
c. 955
d. 797
6. Four people each roll a four die once. Find the probability that at least two people will
roll the same number?
a. 13/18
b. 5/18
c. None of the above
d. 1295/1296
7. A boy entered a shop and bought x number of books for y rupees. When he was about
to leave the bookkeeper said, “if you buy 10 more books, you can have all the books
for 2 rupees and you will also save 80 cents a dozen”. So what are x and y?
a) (5, 1)
b) (10, 1)
c) (15, 1)
d) Cannot be determined.
8. Find the greatest power of 143 which can divide 125! exactly.
a) 11
b) 8
c) 9
d) 7
10. A flight takes off at 2 a.m. from a place at 18N 10E and landed at 36N 70W, 10 hours
later. What is the local time of the destination?
a) 6:00 a.m.
b) 6:40 a.m.
c) 7:40 a.m.
d) 7:00 a.m.
Puzzle (5 marks)
1. What should replace the question marks?