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.

41. Consider the following operations performed on a stack of size 5:
Push(a); Pop(); Push(b); Push(c); Pop(); Push(d); Pop(); Pop(); Push(e);
Which of the following statements is correct?
a. Underflow occurs
b. Stack operations are performed smoothly
c. Overflow occurs
d. None of the above
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).Stack operations are performed smoothly

42. Suppose you are given a binary tree with n nodes, such that each node has exactly either zero or two children. The maximum height of the tree will be
a. n/2 - 1
b. n/2 + 1
c. (n-1)/2
d. (n+1)/2
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).(n-1)/2

43. Which of the following is not an inherent application of stack?
a. Implementation of Stack
b. Evaluation of a postfix expression
c. Job Scheduling
d. Reverse a string
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).Job Scheduling

44. In how many ways can the string
A∩B - A ∩ B -A
be fully parenthesized to yield an infix expression ?
a. 15
b. 14
c. 13
d. 12
View Answer Report Discuss Too Difficult! Search Google
Answer: (a).15

45. The order of a leaf node in a B+ tree is the maximum number of children it can have. Suppose that block size is 1 kilobytes, the child pointer takes 7 bytes long and search field value takes 14 bytes long. The order of the leaf node is ............
a. 16
b. 63
c. 64
d. 65
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).63

46. Which of the following is true for computation time in insertion, deletion and finding maximum and minimum element in a sorted array?
a. Insertion-O(1), Deletion-O(1), Maximum-O(1), Minimum-O(1)
b. Insertion-O(1), Deletion-O(1), Maximum-O(n), Minimum-O(n)
c. Insertion-O(n), Deletion-O(n), Maximum-O(1), Minimum-O(1)
d. Insertion-O(n), Deletion-O(n), Maximum-O(n), Minimum-O(n)
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).Insertion-O(n), Deletion-O(n), Maximum-O(1), Minimum-O(1)

47. The seven elements A, B, C, D, E, F and G are pushed onto a stack in reverse order, i.e., starting from G. The stack is popped five times and each element is inserted into a queue. Two elements are deleted from the queue and pushed back onto the stack. Now, one element is popped from the stack. The popped item is ...................
a. A
b. B
c. F
d. G
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).B

48. What features make C++ so powerful ?
a. Easy implementation
b. Reusing old code
c. Easy Memory Management
d. All of the above
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).All of the above

49. The mechanism that binds code and data together and keeps them secure from outside world is known as
a. Abstraction
b. Inheritance
c. Encapsulation
d. Polymorphism
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).Encapsulation

50. Assume that we have constructor functions for both base class and derived class. Now consider the declaration in main( ). Base * P = New Derived; in what sequence will the constructor be called ?
a. Derived class constructor followed by Base class constructor
b. Base class constructor followed by derived class constructor
c. Base class constructor will not be called
d. Base class constructor will not be called
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).Base class constructor followed by derived class constructor

Page 5 of 27