A directory of Objective Type Questions covering all the Computer Science subjects. Here you can access and discuss Multiple choice questions and answers for various compitative exams and interviews.

71. Which of the following is a correct statement?
a. Composition is a strong type of association between two classes with full ownership
b. Composition is a strong type of association between two classes with partial ownership
c. Composition is a weak type of association between two classes with partial ownership
d. Composition is a weak type of association between two classes with strong ownership
View Answer Report Discuss Too Difficult! Search Google
Answer: (a).Composition is a strong type of association between two classes with full ownership

72. Which of the following is not a correct statement?
a. Every class containing abstract method must be declared abstract
b. Abstract class can directly be initiated with ‘new’ operator
c. Abstract class can be initiated
d. Abstract class does not contain any definition of implementation
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).Abstract class can directly be initiated with ‘new’ operator

73. Consider the following binary search tree. If we remove the root node, which of the node from the left subtree will be the new root?
binary search tree
a. 11
b. 12
c. 13
d. 16
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).16

74. Given the following statements:

(a) To implement Abstract Data Type, a programming language require a syntactic unit to encapsulate type definition.
(b) To implement ADT, a programming language requires some primitive operations that are built in the language processor.
(c) C++, Ada, Java 5.0, C#2005 provide support for parameterised ADT.

Which one of the following options is correct?
a. (a), (b) and (c) are false
b. (a) and (b) are true; (c) are false
c. (a) is true; (b) and (c) are false
d. (a), (b) and (c) are true
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).(a), (b) and (c) are true

75. Match the following types of variables with the corresponding programming languages:

(a) Static variables                   (i) Local variables in Pascal
(b) Stack dynamic                    (ii) All variables in APL
(c) Explicit heap dynamic       (iii) Fortran 77
(d) Implicit heap dynamic       (iv) All objects in JAVA

Codes:
      (a)   (b)   (c)   (d)
a. (i)    (iii)  (iv)   (ii)
b. (iv)  (i)    (iii)   (ii)
c. (iii)  (i)    (iv)   (ii)
d. (ii)   (i)    (iii)   (iv)
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).(iii)  (i)    (iv)   (ii)

76. The number of different binary trees with 6 nodes is .............
a. 6
b. 42
c. 132
d. 256
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).132

77. Let A[1...n] be an array of n distinct numbers. If i < j and A[i] > A[j], then the pair (i,j) is called an inversion of A. What is the expected number of inversions in any permutation on n elements?
a. θ(n)
b. θ(lg n)
c. θ(nlg n)
d. θ(n^2)
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).θ(n^2)

78. Which one of the following array represents a binary max-heap?
a. [26, 13, 17, 14, 11, 9, 15]
b. [26, 15, 14, 17, 11, 9, 13]
c. [26, 15, 17, 14, 11, 9, 13]
d. [26, 15, 13, 14, 11, 9, 17]
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).[26, 15, 17, 14, 11, 9, 13]

79. Match the following:

(a) Huffman codes                              (i) O(n2)
(b) Optimal polygon triangulation     (ii) θ(n3)
(c) Activity selection problem             (iii) O(nlgn)
(d) Quicksort                                         (iv) θ(n)

Codes:
      (a)   (b)   (c)   (d)
a. (i)    (ii)   (iv)   (iii)
b. (i)    (iv)   (ii)   (iii)
c. (iii)  (ii)   (iv)   (i)
d. (iii)  (iv)   (ii)   (i)
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).(iii)  (ii)   (iv)   (i)

80. Suppose that we have numbers between 1 and 1000 in a binary search tree and want to search for the number 364. Which of the following sequences could not be the sequence of nodes examined?
a. 925, 221, 912, 245, 899, 259, 363, 364
b. 3, 400, 388, 220, 267, 383, 382, 279, 364
c. 926, 203, 912, 241, 913, 246, 364
d. 3, 253, 402, 399, 331, 345, 398, 364
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).926, 203, 912, 241, 913, 246, 364