OBJECTIVE TYPE QUESTIONS=
1. Fill in the blanks.
(a) An efficient . . lays the foundation for an efficient program.
(b) An ... . is a step-by-step method of solving a problem.
(c) A . . . is an encoded into some programming language.
algorithm
(d) .. is concerned with comparing algorithms based on the amount of computing resources
used.
(e) Efficiency of a program be evaluated on the basis of
can .. and .
(f) The overall efficiency of a program depends on the amount of . . . an algorithm requires to
solve a program.
(s) . is inversely proportional to the wall clock time.
(h) Classification of algorithm is made on the basis of .... or.... *****
performance.
(i) For linear search, the worst-case running time is. in the size of the list.
G) is a measure of
efficiency of algorithm.
(k) .. is a way to enhance code productivity and quality.
2. State whether the following statements are True or False.
(a) An algorithm is a sequence of instructions written in English-like language.
(b) The best-case running time is the maximum running time for all the possible
inputs.
c) For a binary search, the best case for an input size of N is.when it is sorted.
(d) Efficiency of linear search is better than that of binary search
algorithm when the array is sorted
(e) External factors such as size of input, speed of the computer,
an algorithm's efficiency.
compiler that is used, etc., may affect
(f) Complexity is the only absolute measure for evaluating
program efficiency.
gIn a program execution, more the number of steps, more is the time
taken and lower is the
performance.
(h) As theinput size for a program grows, it affects the efficiency of an
(i) In linear search, the worst case is when the target item is at the end ofalgorithm.
the list or not in the list at all.
) Recursive operations are less efficient than sequential with
to be executed.
programs a large number of instructions
(k) In the below code, number of operations done by the compiler is 10.
x=eva1 (input ("Enter a
nunber: "))
Yeval (input ("Enter another number: "))
sum=x+y
print (sum)
3. Multiple Choice Questions (MCQs)
slowest (or requires the most space or time) is termed ac
(a The input that makes a given algorithm run
(i) Linear (ii) Best-case (ii) Worst-case (iv) Performance
(b) An algorithm whose run time is proportional to problem size, at least for large problem sizes, is called:
(i) Best-case (ii) Linear
(ii) Worst-case (iv) Efficient algorithm
c) The process of locating an element from a collection (like a list or dictionary) or determining whether
it is present or not is called:
(i) Searching (ii) Locating (ii) Addressing (iv) Binding
(d) Which of the following algorithms searches for the given item in a sorted array?
(i) Linear search (ii) Sequential search (ii) Bubble sort iv) Binary search
(e) In a computer system, the ratio of the output to the input given with successful completion of tasks
without wasting time or energy is described as:
(i) Efficiency (i) Execution (ii) Behaviour (iv) Searching
() The performance of a program is inversely proportional to which factor?
(i) User time (i) Execution time (ii) CPU time iv) Memory
which technique reduces the amount of time taken
by an algorithm function of the
(g) of the input?
to run as a
length
() while loop (ii) for loop
(i) conditional constructs (iv) recursion
thl In which process is each element of the array compared with the given item to be searched one by one?
(i) (ii) Binary search
Linear search (ii) Bubble sort (iv) Insertion sort
Which among the following is the best sorting technique when number of elements is lesser?
(i) Selection sort (ii) Bubble sort (ii) Merge sort (iv) Insertion Sort
turn out to be worst case?
(i) Under which situation does binary search algorithm
a
(ii) Unsorted sort (ii) Linear array iv) Linear list
(i) Sorted array
Chapter-5
1. Fill in the blanks:
(a) algorithm (b) algorithm (c) program (d) Algorithm analysis
(g) Performance
(e) time, number of operations () space/memory
(i) linear G) Complexity (k) Code optimization
(h) best-case, worst-case, average-case
2 True or False:
(B) True
(a) True (b) False (c) True (d) False (e) True (f) False (h) True
(i) True 0) False (k) False
3. Multiple Choice Questions (MCQs):
(a) (ii) (b) (i) (c) (i) (d) (iv) (e) (i) () (i) () (iv) (h) ()
(i) (iv) ) (i)