UGC NET COMPUTER SCIENCE SOLVED PAPERS 2014-16 - UGC NET Computer Science Paper 2 December 2015

11. Consider the following program:
#include
main()
{
int i, inp;
float x, term=1, sum=0;
scanf("%d %f",&inp, &x);
for(i=1;i<=inp;i++)
{
term=term*x/i;
sum=sum+term;
}
printf(“Result=%f\n”,sum);
}
The program computes the sum of which of the following series?

  • Option : B
  • Explanation : Fro i=1: term = term * x / i = 1 * x / 1 = x. sum = sum + term = x. For i = 2: term = x * x / 2 = x2 / 2. sum = x + x2 / 2. For i = 3: term = x2 / 2 * x / 3 = x3 / 3! . sum = x + x2 / 2 + x3 / 3!. and so on... So, option (B) is correct.
Cancel reply
Cancel reply

14. Match the following database terms to their functions:

List I                                  List II
  (a) Normalization(i) Enforces match of primary key to foreign key
  (b) Data Dictionary(ii) Reduces data redundancy in a databae
  (c) Referential Integrity(iii) Define view(s) of the database for particular user(s)
  (d) External Schema(iv) Contains metadata describing database structure.

      (a)  (b)  (c)  (d)
(A) (iv) (iii) (i) (ii)
(B) (ii) (iv) (i) (iii)
(C) (ii) (iv) (i) (iii)
(D) (iv) (iii) (ii) (i)

  • Option : B
  • Explanation :
    • Normalization reduces data redundancy in a database
    • Data Dictionary contains metadata describing database structuredefines view(s) of the database for particular user(s)
    • Referential Integrity enforces match of primary key to foreign key
    • External Schema defines view(s) of the database for particular user(s)

    So, option (B) is correct.
Cancel reply
Cancel reply

15. In general, in a recursive and non-recursive implementation of a problem (program) :

  • Option : B
  • Explanation : In general, in a recursive and non-recursive implementation of a problem (program) both time and space complexities are better in non-recursive than in recursive program. In some program recursive implementation gives worst case scenario too. So, recursive implementation does not guarantee for best case all the time. So, optipon (B) is correct.
Cancel reply
Cancel reply