The running time of an algorithm T(n),where 'n' is the input size, of a recursive algorithm is given as follows.is given by
T(n) =c + T(n  1), if n > 1
A.  n^{2} 
B.  n 
C.  n^{3} 
D.  n^{n} 
Option: B Explanation :
By recursively applying the relation we finally arrive at
T(nI) = c(nI) + T (1) = c(nI)+d
So, order is n
'> 
A.  F3, F4, FI, F5, F6, F2 
B.  F2, F6, F5, Fl, F4, F3 
C.  Fl, F2, F3, F4, F5, F6 
D.  Ordering is immaterial as all files are accessed with the same frequency 
Option: A Explanation :
Since the access is sequential, greater the distance, greater will be the access time. Since all the files are referenced with equal frequency, overall access time can be reduced by arranging them as in option (a).

A.  268 units 
B.  256 units 
C.  293 units 
D.  210 units 
Option: A Explanation :
Since each file is referenced with equal frequency and each record in a particular file can be referenced with equal frequency, average access time will be (25 + (50 + 40) + (50 + 80 + 50) + ... )/6 = 268 (approximately).

A.  max (f (n) ,g (n)) 
B.  min (f (n) ,g (n) ) 
C.  f (n) + g (n) 
D.  f (n) x g (n ) 
Option: A Explanation :
By definition of order, there exists constants c1, ec2, n1, n2 such that
T (n) ≤ c1 x f (n) , for all n ≥ n1.
T (n) ≤ c2 x f (n) , for all n ≥ n2.
N = max (n1, n2) andC = max (c1, c2). So,
T (n) ≤ C x f(n) for all n ≥ N
T (n) ≤ C x g (n) for all n ≥ N
T(n) ≤ C/2 x (f(n)+g(n))
Without loss of generality, let max ( f (n), g (n)) =f(n) .
So, T (n) ≤ C / 2 (f(n) + f (n) ) ≤ C x f(n) .
So, order is f(n) , which is max (f(n), g (n) ) , by our assumption.

Syllabus covered in this section is
This Section covers Data Structures Questions Answers using C language .
Who can benefit 
Various Search Terms used for this section are