UGC NET COMPUTER SCIENCE SOLVED PAPERS 2014-16 - UGC NET Computer Science Paper 2 August 2016

31. The number of strings of length 4 that are generated by the regular expression (0+1+|2+3+)*, where | is an alternation character and {+, *} are quantification characters, is:

  • Option : C
  • Explanation :
    Possible strings of length 4 are: 0001, 0111, 0011, 0101, 0123, 2323, 2333, 2223, 2233, 2301. Total 10 strings are possible. So, option (C) is correct.
Cancel reply
Cancel reply

33. In compiler optimization, operator strength reduction uses mathematical identities to replace slow math operations with faster operations. Which of the following code replacements is an illustration of operator strength reduction ?

  • Option : B
  • Explanation :
    In option (B), Multiplication operation is replaced with Shift Operator . It reduce the operator strength because shift operator is less expensive than multiplication operation. So option (B) is correct.
Cancel reply
Cancel reply

34. Which of the following are the principles tasks of the linker?
I. Resolve external references among separately compiled program units.
II. Translate assembly language to machine code.
III. Relocate code and data relative to the beginning of the program.
IV. Enforce access-control restrictions on system libraries.

  • Option : B
  • Explanation : Principles tasks of the linker are:
    1. Resolve external references among separately compiled program units.
    2. Relocate code and data relative to the beginning of the program.
    • Assembler translate assembly language to machine code.
    • Loader enforces access-control restrictions on system libraries.
    So, option (B) is correct.
Cancel reply
Cancel reply

35. Which of the following is FALSE?

  • Option : B
  • Explanation :
  • The grammar S→aS|aSbS|∈, where S is the only non-terminal symbol, and ∈ is the null string, is ambiguous.Correct
  • An unambiguous grammar has same left most and right most derivation.Inorrect
  • An ambiguous grammar can never be LR(k) for any k.Correct
  • Recursive descent parser is a top-down parser.Correct
  • So, option (B) is correct.
Cancel reply
Cancel reply