#### 31. the number of different binary trees with 6 nodes is

#### (1) 6

#### (2) 42

#### (3) 132

#### (4) 256

####
**Answer : 3**

#### 32. Let A[1…n] be an array of n distinct numbers. If i<j and a[i]>a[j], the the pair (I,j) is called an inversion of A. what is the expected number of inversion in any permutation on n elements

#### (1) Θ(n)

#### (2) Θ(lgn)

#### (3) Θ(nlgn)

#### (4) Θ(n2)

####
**Answer : 1**

#### 33. Which one of the following array represents a binary max-heap?

#### (1) [26,13,17,14,11,9,15]

#### (2) [26,15,14,17,11,9,13]

#### (3) [26,15,17,14,11,9,13]

#### (4) [26,15,13,14,11,9,17]

####
**Answer : 2**

#### 34. Math the following

#### (a)Huffman codes (i) O(n2)

#### (b) Optimal polygon triangulation (ii) Θ(n3)

#### ( c) Activity selection problem (ii) O(nlgn)

#### (d) Quick sort (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)

####
**Answer : 4**

#### 35. Suppose that we have numbers 1 and 1000 in a binary search tree and want to search for the number 364. Which of the following sequence could not be the sequence of nodes examined?

#### (1) 925,221,912,245,899,259,363,364

#### (2) 3,400,388,220,267,383,382,279,364

#### (3) 926,203,912,241,913,246,364

#### (4) 3,253,402,399,331,345,398,364

####
**Answer : 4**

#### 36. A triangulation of a polygon is a set of T chords that divide the polygon into disjoint triangles. Every triangulation o0f n-vertex convex polygon has _____ chords and divides the polygon into ____ triangles

#### (1) n-1,n-1

#### (2) n-3,n-2

#### (3) n-1,n

#### (4) n-2,n-2

####
**Answer : 4**

#### 37. Implicit return type of a class construction is:

#### (1) not of class type itself

#### (2) Class type itself

#### (3) A destructor of class type

#### (4) a destructor not of class type

####
**Answer : 4**

#### 38. It is possible to define a class within a class termed as nested class. There are _____ types of nested classes.

#### (1) 2

#### (2) 3

#### (3) 4

#### (4) 5

####
**Answer : 2**

#### 39. Which of the following statements is correct?

#### (1) Aggregation is a strong type of association between two classes with full ownership .

#### (2) Aggregation is a strong type of association between two classes with partial ownership.

#### (3) Aggregation is a weak type of association between two classes with partial ownership.

#### (4) Aggregation is a weak type of association between two classes with full owner ship.

####
**Answer : 3**

#### 40. Which of the following statements is correct?

#### (1) Every class containing abstract method must not be declare abstract

#### (2) Abstract class cannot be directly initiated with new operator.

#### (3) Abstract class cannot be initiated.

#### (4) Abstract class contains definition of implementation.

**Answer : 4**

## No comments:

## Post a Comment