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

36. Match the following:

a. Prim's algorithmi. O(V2E)
b. Bellman-Ford algorithmii. O(VE lgV)
c. Floyd-warshall algorithmiii. O(E lgV)
d. Johnson's algorithmiv. O(V3)

Where V is the set of nodes and E is the set of edges in the graph.
Codes:

 abcd
(1)iiiiivii
(2)iiiiiiiv
(3)iiiiivii
(4)iiiiiiiv

  • Option : C
  • Explanation :
  • Prim’s algorithm takes O(E lgV) time.
  • Bellman-Ford algorithm takes O(V2E) time.
  • Floyd-Warshall algorithm takes O(V3) time.
  • Johnson’s algorithm takes O(VE lgV) time.
  • So, option (C) is correct.
Cancel reply
Cancel reply

37. Constructors have _____ return type.

  • Option : D
  • Explanation :
    Constructors have no return type. For more information on constructors Refer:Constructors in C++ Option (D) is correct.
Cancel reply
Cancel reply

38. Method over-riding can be prevented by using final as a modifier at ______.

  • Option : B
  • Explanation :
    Method over-riding can be prevented by using final as a modifier at the start of method declaration. For detailed information and program Refer:Overriding in Java Option (B) is correct.
Cancel reply
Cancel reply

39. Which of the following is a correct statement?

  • Option : A
  • Explanation :
  • Composition is a strong type of association between two classes with full ownership. Correct.
  • Composition is a strong type of association between two classes with partial ownership.Incorrect
  • Composition is a weak type of association between two classes with partial ownership.Incorrect
  • Composition is a weak type of association between two classes with strong ownership.Incorrect
  • So, option (A) is correct.
Cancel reply
Cancel reply

40. Which of the following is not a correct statement?

  • Option : B
  • Explanation :
  • Every class containing abstract method must be declared abstract.Correct Declaration is required.
  • Abstract class can directly be initiated with ‘new’ operator. No it can't be initiated directed by only 'new' operator. So, it is Inorrect
  • Abstract class can be initiated.Correct
  • Abstract class does not contain any definition of implementation.Correct
  • So, option (B) is correct.
Cancel reply
Cancel reply