CBSE - MCQ Question Banks (के. मा. शि. बो . -प्रश्नमाला )

PreviousNext

Q. 190801 R is a 2D array [8 x 6]. Each element of the array is stored in 2 memory locations. If R[1,0] begins at address 250, find the location of R[3,2]. Use the row major arrangement formula.


A. 266

B. 264

C. 262

D. 278

Right Answer is: D

SOLUTION

Base address B = 250
Element size w = 2 bytes
No. of columns n = 6
Lr = 1; Lc =0
Location R[3,2] = 250 + 2 (6(3-1)+(2-0))
                         = 250 + 2 (6(2)+(2))
                         = 250 + 2 (12+2)
                         = 250 + 2 (14)
                         = 250 + 28
                         = 278  


Q. 190802 Each element of an array A[-20..20, 10..35] requires one byte of storage. If the array is stored in column major order beginning location 500, detemine the location of A[0,20].


A. 930.

B. 1176

C. 1160

D. 1076

Right Answer is: A

SOLUTION

Base address B = 500
Element size w = 1 byte
r (number of rows) are 20-(-20)+1=40+1=41
Ir = -20; Ic = 10
Address of A[0,20] = 500 + 1(0-(-20)+41(20-10))]
                              = 500 + 1(20 + 41 x 10)
                              = 500 + (20+410)
                              = 500 + (430)
                              = 930. 


Q. 190803 R is a 2D array [12 x 4 ]. Each element of the array is stored in 2 memory locations. If R[1,1] begins at address 220. Find the location of R[6,2]. Use the row major arrangement.


A. 272

B. 242

C. 262

D. 252

Right Answer is: C

SOLUTION

Base address B = 220
Element size w = 2 bytes
number of columns = 4 
Lr = 1 ; Lc = 1
Location R [6,2] = 220 + 2 (4 (6-1)+(2-1))
                          = 220 + 2 (4 (5) + (1))
                          = 220 + 2 (21)
                          = 220 + 42
                          = 262.    


Q. 190804 The technique used to store columns in an array is known as


A. column minor

B. column major

C. row minor

D. row major

Right Answer is: B

SOLUTION

This linearization technique stores first the first column, then the second column, then the third column and so forth. The formula for address calculation of (I, J)th element in array X(Lr : Ur, Lc : Uc) with base address B and element size w is given below:
Address(I,J) = B + w[r(J-Lc)+(I-Lr)]
where r is the number of rows i.e. length of a column array Lr : Ur i.e., Uc - Lc +1.


Q. 190805 The technique used to store rows in an array is known as


A. column minor

B. column major

C. row minor

D. row major

Right Answer is: D

SOLUTION

This linearization technique stores first the first row of the array, then the second row, then the third column and so forth. The formula for address calculation of (I, J)th element in array of m x n elements with base address B and element size W bytes is given below:

Address of (I,J) in Row-major order = B + W[n(I-1)+(J-1)]
where m are the number of rows and n are the number of columns.

More generalized form of formula for address calculation of [I,J] element of array AR[(Lr : Ur, Lc : Uc) with base address B and element size w is given below:
Address(I,J)th element = B + W[n(I-Lr)+(J-Lc)]
where n is the number of columns i.e. length of array [Lc : Uc] i.e., Uc - Lc +1:Lr is first row number, Lc is first column number.


Q. 190806 In Insertion Sort


A. each element is inserted in its proper position in a sorted sub array

B. two adjoining values are compared and interchanged if not in proper order

C. the smallest value in the unsorted array is chosen and positions are exchanged

D. values are arranged in different classes

Right Answer is: A

SOLUTION

In insertion sort, each successive element is picked and inserted at an appropriate position in the previously sorted array. This sorting algorithm is frequently used when n is small.


Q. 190807 In Bubble Sort


A. each element is inserted in its proper position in a sorted sub array

B. two adjoining values are compared and interchanged if not in proper order

C. the smallest value in the unsorted array is chosen and positions are exchanged

D. values are arranged in different classes

Right Answer is: B

SOLUTION

In bubble sort, the adjoining values are compared and exchanged if they are not in proper order. This process is repeated until the entire array is sorted.


Q. 190808 In Selection Sort


A. each element is inserted in its proper position in a sorted sub array

B. two adjoining values are compared and interchanged if not in proper order

C. the smallest value in the unsorted array is chosen and positions are exchanged

D. values are arranged in different classes

Right Answer is: C

SOLUTION

In selection sort, the smallest (or largest depending upon the desired order) key from the remaining unsorted array is searched for and put in the sorted array. This process repeats until the entire array is sorted.


Q. 190809 Out of the following the correct statement is


A. Binary and Linear are two popular sorting techniques.

B. Merge-sort creates a sorted output.

C. Bubble and selection are popular searching techniques

D. A data structure with a pointer is a structure.

Right Answer is: B

SOLUTION

Merging means combining elements of two arrays to form a new array. Simplest way of merging two arrays is that first copy all the elements of one array into new array and then copy all the elements of other array into new array. If you want the resultant array to be sorted, you can sort the resultant array.


Q. 190810 Out of the following the false statement is


A. Binary search works if the array is in ascending order

B. The array name is like a pointer

C. An element cannot be deleted from a sorted array

D. An array can store pointers.

Right Answer is: C

SOLUTION

Binary search can work for only sorted arrays whereas linear search can work for both sorted as well as unsorted arrays. The element to be deleted is first searched for in the array using one of the search techniques i.e., either linear search or binary search. If the search is successful, the element is removed and rest of the elements are shifted so as to keep the order if array undisturbed.


Q. 190811 In an array, the element numbers in paranthesis are called


A. values.

B. subscripts.

C. data.

D. bounds.

Right Answer is: B

SOLUTION

The subscript or index of an element designates its position in an array.


Q. 190812 The mid element is compared repeatedly with the value to search, in


A. Binary Search.

B. Linear Search.

C. Quick Search.

D. Tree Search.

Right Answer is: A

SOLUTION

Binary Search searches for the given item in a sorted array. The search segment reduces to half at every successive stage.


Q. 190813 Each element is compared sequentially with the value to search in


A. Binary Search.

B. Linear Search.

C. Quick Search.

D. Tree Search.

Right Answer is: B

SOLUTION

In linear search, each element of the array is compared with the given Item to be searched for, one by one.


Q. 190814 If we want to convert the infix expression 8*10*(6-4)+28 into equivalent postfix form, the result is


A. 810 * 64-*28+.

B. 810 * 64-+28*.

C. 810 **64- 28+.

D. *810 64-*28+.

Right Answer is: A

SOLUTION

8*10*(6-4)+28 = (810*)*(64-)28+ = 810 * 64-*28+.


Q. 190815 In a queue, deletion of an element takes place at the


A. rear end.

B. front end.

C. front or rear end.

D. second index element, leaving first index for null.

Right Answer is: B

SOLUTION

Front stores the index of first element in the queue. In a queue deletion is always takes place at the front end.


Q. 190816 In a queue, insertions take place at the


A. rear end.

B. front end.

C. front or rear end.

D. second last index element, leaving last index for null.

Right Answer is: A

SOLUTION

Rear stores the index of last element in the queue. In a queue insertion of elements is always takes place at the rear end.


Q. 190817 The notation in which operator symbol is placed in between the operands is called


A. postfix notation.

B. prefix notation.

C. infix notation.

D. increment notation.

Right Answer is: C

SOLUTION

Infix notation is the common arithmetic and logical notation where operators are placed in between the operands.


Q. 190818 The operations that we can perform on a stacks are


A. insertion and deletion.

B. modification and display.

C. traversal.

D. push and pop.

Right Answer is: D

SOLUTION

Push is to insert an element in a stack, whereas pop is to delete an element from the stack.


Q. 190819 If front=0 and rear=4, the deletion of 2 elements will result in


A. Front=2 and rear =4.

B. Front=1 and rear=3.

C. Front=0 and rear=2.

D. Front=-2 and rear=4.

Right Answer is: A

SOLUTION

Deletion takes place at the front end which increase the value of front. Thus deletion of 2 elements cause front to increase by 2 and rear remains same.


Q. 190820 Two pointers to maintain the front and rear position in a queue are present in


A. circular queues.

B. linked queues.

C. dequeue.

D. simple queues.

Right Answer is: B

SOLUTION

Linked queues have links among its elements and it maintains two pointers to store the "front" position and "rear" position.


Q. 190821 The equivalent infix expression for a, b, AND, a, c, AND, OR is


A. a b AND OR a AND c.

B. a AND b OR a AND c

C. a AND b OR a c AND.

D. a AND b a AND c OR.

Right Answer is: B

SOLUTION

The operator comes in between operands in infix expression. Example: a, b, AND, a, c, AND, OR = (a AND b a AND c) OR = a AND b OR a AND c.


Q. 190822 The queue that considers itself contiguous at opposite ends is


A. linked queue.

B. input restricted queue.

C. circular queue.

D. dequeue.

Right Answer is: C

SOLUTION

Circular queues are implemented in circular forms rather than in straight lines. That is why, if space is there in the beginning, the rear shifts back to the beginning after reaching the maximum possible index number.


Q. 190823 Deletion in a linked queue can take place at


A. the rear end only.

B. the front end only.

C. both rear and front end.

D. the middle of the queue.

Right Answer is: B

SOLUTION

It is just like the simple queue where front end gets modified when deletion takes place.


Q. 190824 Insertion in a linked queue can take place at


A. the rear end only.

B. the front end only.

C. both rear and front end.

D. the middle of the queue.

Right Answer is: A

SOLUTION

It is like a simple queue where rear end gets modified when insertion takes place.


Q. 190825 If front=0 and rear=4, the insertion of 2 elements will result in


A. Front=2 and rear =4.

B. Front=1 and rear=5.

C. Front=0 and rear=6.

D. Front=1 and rear=6.

Right Answer is: C

SOLUTION

At every insertion, value of rear increases by 1 and front remains the same. Here rear will be increases by 2 and front will remain the same.


Q. 190826 The queues having links among its elements are called


A. circular queues.

B. linked queues.

C. dequeue.

D. simple queues.

Right Answer is: B

SOLUTION

Linked queues have links among its elements, and it maintains two pointers to store the "front" position and "rear" position.


Q. 190827 At every deletion in a queue the value of


A. front decreases by 1.

B. front increases by 1.

C. rear decreases by 1.

D. rear increases by 1.

Right Answer is: B

SOLUTION

Deletion takes place at the front end, and always increases value of front according to the number of deletions.


Q. 190828 The technical term for deleting an element in a stack is called


A. pushing.

B. dropping.

C. popping.

D. inserting.

Right Answer is: C

SOLUTION

To delete an element in a stack, we use pop operation. We can pop the top most elements in a stack.


Q. 190829 The technical term for inserting a new element in a stack is called


A. pushing.

B. dropping.

C. popping.

D. inserting.

Right Answer is: A

SOLUTION

To add an element in a stack, we use push operation.Thus the process refers to "pushing"


Q. 190830 The full form of dequeue is


A. destructive queue.

B. destroy queue.

C. double ended queue.

D. delete queue.

Right Answer is: C

SOLUTION

Dequeue is a queue in which elements can be added or removed at either end.


Q. 190831 The other name for free pool is


A. unoccupied list.

B. node list.

C. store list.

D. avail list.

Right Answer is: D

SOLUTION

A free pool is a list keeping account of available free memory. It is a data structure used in a scheme for dynamic memory allocation. It operates by connecting unallocated regions of memory.


Q. 190832 A list keeping account of freely available memory is the


A. occupied storage.

B. unavailable list.

C. free storage.

D. garbage storage.

Right Answer is: C

SOLUTION

The other name for free storage list is free pool and it keeps an account of the freely available memory.


Q. 190833 The other term for prefix expression is


A. polish notation.

B. reverse polish notation.

C. prefix expression.

D. pushing.

Right Answer is: A

SOLUTION

Prefix expression(also called polish notation of an expression). It is an expression where operators are placed before operands.


Q. 190834 If we want to convert the infix expression (P-Q)*(M/N) +R into equivalent postfix form, the result is


A. PQ-MN*/R+.

B. P-QMN/*R+.

C. PQ-MN/*R+.

D. PQ-MN/*+R.

Right Answer is: C

SOLUTION

(P-Q)*(M/N) +R = (PQ-)*(MN/) R+ = PQ-MN/*R+.  


Q. 190835 The equivalent prefix expression of (A+B) / (C*D)- Z is


A. AB+CD*/Z-.

B. AB+ / CD* Z.

C. +AB / *CD-Z.

D. -/+AB*CDZ.

Right Answer is: D

SOLUTION

In prefix expression, operators are placed before the operands.
Here, the expression (A+B) / (C*D)- Z = (+AB / *CD )-Z = -/+AB*CDZ


Q. 190836 The equivalent prefix expression of A+B-D/X is


A. -+AB/DX.

B. AB+DX/-.

C. -A+B/DX.

D. -+/ABDX.

Right Answer is: A

SOLUTION

In prefix expression, operators are placed  before the operand. Here, A+B-D/X I= +AB - /DX = -+AB/DX.


Q. 190837 The equivalent infix expression for 8, 10, *, 6, 4, -, *, 28, + is


A. 8 * 10 + ((6-4) * 28).

B. 8*10*(6-4)+28.

C. 8+ 10 * (6-4) *28.

D. 8*10* (6+4) – 28.

Right Answer is: B

SOLUTION

In an infix expression, operators are placed between its operands.  


Q. 190838 The stack having capacity of 8 elements implemented as an array is A, B, C, D, E, F, G (on top). If the operations POP (STACK, ITEM) takes place 4 times, the result is


A. G, F, E (on top).

B. A, B, C (on top).

C. E, F, G(on top).

D. C, B, A (on top).

Right Answer is: B

SOLUTION

Step 1: A, B, C, D, E, F (on top). Step 2: A, B, C, D, E (on top). Step 3: A, B, C, D (on top). Step 4: A, B, C (on top).


Q. 190839 If we want to convert the infix expression [(8+5)* (6*9)] + (6-3) into equivalent postfix expression, the result is


A. 85+69**63+-.

B. 85+69**63-+.

C. 85+*69*63-+.

D. 85+69**+63-.

Right Answer is: B

SOLUTION

[(85+) * (69*)]+(63-) = (85+69**) + (63-) = 85+69**63-+.  


Q. 190840 If we evaluate the postfix expression 20, 45, +, 20, 10, -15, +, * using stacks, then the result is


A. 215.

B. 665.

C. 1620.

D. 1625.

Right Answer is: D

SOLUTION

It would be (20+45) *((20-10) + 15) = 65 * 25 = 1625.


Q. 190841 The stack having capacity of 8 elements implemented as an array is A, B, C, D, E, F, G (on top). If the operations POP (STACK, ITEM), PUSH (STACK, K), PUSH (STACK, M ) takes place successively, the result is


A. A, B, C, D, E, F, G, M, K (on top).

B. K, M, A, B, C, D, E, F (on top).

C. (on top) M, K, B, C, D, E, F, G.

D. A, B, C, D, E, F, K, M (on top).

Right Answer is: D

SOLUTION

Push and Pop operations can take place only at one end.
It would be Step 1: A, B, C, D, E, F. Step 2: A, B, C, D, E, F, K. Step 3: A, B, C, D, E, F, K, M.


Q. 190842 The elements (in order) of a stack are 10, 20, 30, 40, 50. The element that will be first popped up from the stack is


A. 10.

B. 20.

C. 40.

D. 50.

Right Answer is: D

SOLUTION

As a stack is implemented in LIFO manner, so the last element to be pushed in the stack is first element to be popped up.


Q. 190843 The equivalent infix expression for 8, 5, +, 6, 9, *, *, 6, 3, - ,+ is


A. [(8+5)* (6*9)] + (6-3).

B. [(8*5)+ (6*9)] + (6-3).

C. [(8+5)* (6-9)] * (6-3).

D. [(8*5)+ (6*9)] - (6+3).

Right Answer is: A

SOLUTION

In an infix expression, operators are placed between operands.


Q. 190844 The equivalent postfix expression of (A+B) / (C*D)- Z is


A. AB+CD*/-Z.

B. AB+CD/*Z-.

C. AB+CD*/Z-.

D. ABCD*/Z-+.

Right Answer is: C

SOLUTION

In postfix expression, operator comes after the operand. Here, the expression (A+B) / (C*D)- Z = AB+ / CD* Z- = AB+CD*/Z-


Q. 190845 The equivalent postfix expression of A+B-D/X is


A. AB+DX-/.

B. AB+DX/-.

C. ABDX+/-.

D. ABDX/-+.

Right Answer is: B

SOLUTION

In postfix expression, operator comes after the operand. Here, A+B-D/X = AB+ - DX/ = AB+DX/-.


Q. 190846 If front=0, and rear=2, the next element in a queue will be inserted at


A. 3rd position.

B. 2nd position.

C. 1st position.

D. the last position.

Right Answer is: A

SOLUTION

Insertion always takes place at the rear end. front             rear

0 1 2 3 4


Q. 190847 The number of elements in a queue at any given time can be calculated from the values of the


A. front end.

B. rear end.

C. both front and rear end.

D. middle element.

Right Answer is: C

SOLUTION

Front stores the index of first element in the queue. Rear stores the index of last element in the queue. The formula to calculate the number of elements in a queue is = front - rear + 1


Q. 190848 What is the AVAIL list?
A. front end.
B. rear end.
C. both front and rear end.
D. middle element.

Right Answer is:

SOLUTION

AVAIL list keeps account of the available memory locations.  It is used when memory is allocated during run time.               


Q. 190849 Evaluate the given postfix expression, showing the stack at every stage.                                                                                       20  10  +  12  10  -   *   4  1  -  3  ^  +
A. front end.
B. rear end.
C. both front and rear end.
D. middle element.

Right Answer is:

SOLUTION

Stages are:-                                                     

 

Element

Operation

Stack

1

20

push

20

2

10

push

20  10

3

+

pop

pop

perform 20 + 10

push result

30

4

12

push

30  12

5

10

push

30  12  10

6

-

pop

pop

perform 12 - 10

push result

30  2

7

*

pop

pop

perform 30 * 2

push result

60

8

4

push

60  4

9

1

push

60  4  1

10

-

pop

pop

perform 4 - 1

push result

60  3

11

3

push

60  3  3

12

^

pop

pop

perform 3 ^ 3

push result

60  27

13

+

pop

pop

perform 60 + 27

push result

87

 


   
            

 Result -  87  


Q. 190850 Evaluate the given postfix expression, showing the stack at every stage.          15  3  +  4  *   6   7   5  -   /   -
A. front end.
B. rear end.
C. both front and rear end.
D. middle element.

Right Answer is:

SOLUTION

Stages are:-

 

Element

Operation

Stack

1

15

push

15

2

3

push

15  3

3

+

pop

pop

perform 15 + 3

push result

18

4

4

push

18  4

5

*

pop

pop

perform 18 * 4

push result

72

6

6

push

72  6

7

7

push

72  6  7

8

5

push

72  6  7  5

9

-

pop

pop

perform 7 - 5

push result

72  6  2

10

/

pop

pop

perform 6 / 2

push result

72  3

11

-

pop

pop

perform 72 - 3

push result

69

 

Result = 69   


Q. 190851 Convert the given infix expression to postfix, showing the stack at every stage.                       (true AND false) OR  NOT(false OR True)
A. front end.
B. rear end.
C. both front and rear end.
D. middle element.

Right Answer is:

SOLUTION

:  Input expression :         (true AND false) OR  NOT(false OR True)                              

 

Element

Stack

Expression Y in Postfix

1

 

(

 

2

(

((

 

3

true

((

true

4

AND

((AND

true

5

false

((AND

true false

6

)

(

true false AND

7

OR

(OR

true false AND

8

NOT

( OR NOT

true false AND

9

(

(OR NOT (

true false AND

10

false

(OR NOT(

true false AND false

11

OR

(OR NOT(OR

true false AND false

12

true

(OR NOT(OR

true false AND false true

13

)

(OR NOT

true false AND false true OR

14

)

 

true false AND false true OR NOT OR


The Postfix expression is :  true false AND false true OR NOT OR        


Q. 190852 What is the difference between a linear queue and a circular queue?
A. front end.
B. rear end.
C. both front and rear end.
D. middle element.

Right Answer is:

SOLUTION

In a linear queue, insertions are at the rear and deletions are from the front.  As more elements are added, rear keeps moving ahead and ultimately reaches the last location of the array.  As more elements are deleted, front also moves ahead, leaving behind locations from which values have been extracted.  An attempt to insert another value at this stage would give an error, “Overflow” , as the queue is considered full if  rear has reached the last array location, even if there is space available before front. 

 

In case of circular queue, this space is utilized.  When rear is at the end of the array, it moves to the first location and stores a value.  Thus, the array is considered full when front is at the first position and rear is at the last, or, when rear lies just before front.

                                                              front                       rear

 

 

34

45

  

 

 
Q[0]                                Q[1]                        Q[2]                          Q[3]

 

Consider the above example where front is at index number 2 and rear is at index 3.  In a linear queue, no more elements can be added. 

But in a circular queue,  read would become 0 and store a value.  Thus, the 2 locations before front will be used.           

 


Q. 190853 Explain deque and its variations?
A. front end.
B. rear end.
C. both front and rear end.
D. middle element.

Right Answer is:

SOLUTION

Deque or double-ended queue, is a special kind of queue in which elements can be inserted and deleted from either end, but not in the middle. 

The deque can be of two types – input restricted deque and output restricted deque. 


An input restricted deque is a dequeue which allows insertions are allowed at one end but allows deletions at both ends of the list.


An output restricted deque is a deque which allows deletions at only one end of the list but allows insertions at both ends of the list.                          


Q. 190854 Two or more functions can share the same name as long as there ________ are different.


A. Parameter declarations

B. Arguments

C. Function definitions

D. Parameter definitions

Right Answer is: A

SOLUTION

Two or more functions can share the same name as long as their parameter declarations are different. This could include:


Q. 190855 Process of using a function for more than one purpose is called:


A. Encapsulation

B. Overriding

C. Data hiding

D. Polymorphism

Right Answer is: D

SOLUTION

Polymorphism is the ability of an object to behave differently in different circumstances can effectively be implemented in programming through function overloading.


Q. 190856 The arguments that prevent temporary modification of the argument are called:


A. Default arguments

B. Static arguments

C. Constant arguments

D. Function arguments

Right Answer is: C

SOLUTION

Constant arguments prevent temporary modification of the argument. The keyword const added in the beginning of an argument declaration, to prevent the argument from being modified within the body of the called function.


Q. 190857 _____________ provide greater flexibility to the programmer.


A. Function arguments

B. Function parameters

C. String arguments

D. Default arguments

Right Answer is: D

SOLUTION

Default arguments are useful in situation where some arguments always have the same value. It provides greater flexibility to the programmer. It can be used to add new parameters to an existing function.


Q. 190858 ___________ are the values given in the function declaration.


A. Function arguments

B. Function parameters

C. Default arguments

D. String arguments

Right Answer is: C

SOLUTION

They are the values given in the function declaration that compiler automatically inserts during the function call. Such insertion is done when the caller does not provide a value for that argument in the function call.


Q. 190859 Function overloading __________ the number of comparisons in a program.


A. Reduces

B. Increases

C. Doubles

D. Triples

Right Answer is: A

SOLUTION

Function overloading reduces number of comparisons in a program and thereby making the program run faster.


Q. 190860 Late binding is also known as ___________.


A. Early binding

B. Dynamic binding

C. Binding

D. Static binding

Right Answer is: B

SOLUTION

Late binding is also known as dynamic binding. In late binding, the binding is done at the run time (during program execution).


Q. 190861 Early binding is also known as ___________.


A. Late binding

B. Late binding

C. Binding

D. Static binding

Right Answer is: D

SOLUTION

Early binding is also known as static binding. In early binding, the binding of identifiers is done at the compile time.


Q. 190862 Binding is of ____ types.


A. Three

B. Two

C. Four

D. Five

Right Answer is: B

SOLUTION

Binding is of two types – early binding and late binding. In early binding, the binding of identifiers is done at the compile time. In late binding, the binding is done at the run time (during program execution).


Q. 190863 Function overloading can be achieved in _____ ways.


A. Three

B. Four

C. Two

D. Five

Right Answer is: C

SOLUTION

Function overloading can be achieved by passing different number of arguments and by passing different types of arguments.


Q. 190864 C++ implements ___________ through overloaded functions.


A. Encapsulation

B. Overriding

C. Binding

D. Polymorphism

Right Answer is: D

SOLUTION

C++ implements polymorphism through overloaded functions. The overloaded functions are invoked by matching arguments, both type of arguments and number of arguments.


Q. 190865 Method with the same name and different signature result in ______________.


A. Function overloading

B. Function overriding

C. Encapsulation

D. Polymorphism

Right Answer is: A

SOLUTION

Method with the same name and different signature result in function overloading. Function overloading is used to enhance the readability of the program. It also reduces number of comparisons in a program and thereby makes the program run faster.


Q. 190866 A method with the same name and same signature results in ____________.


A. Overloading

B. Function overriding

C. Polymorphism

D. Encapsulation

Right Answer is: B

SOLUTION

Method overriding or function overriding occurs has the same name and same signature in both the base and derived class.


Q. 190867 _________ are the main building blocks of a program.


A. Methods

B. Source codes

C. Segments

D. Overloaded functions

Right Answer is: A

SOLUTION

A function is a collection of statements grouped together. The methods or functions are the main building blocks of a program.


Q. 190868 A collection of statements grouped together is called _____________.


A. Program

B. Segment

C. Function

D. Function overloading

Right Answer is: C

SOLUTION

A function is a collection of statements grouped together. The methods or functions are the main building blocks of a program.


Q. 190869 Method with the same name and signature is known as _____________.
Right Answer is:

SOLUTION

Method/function overriding


Q. 190870 What do you mean by binding?
Right Answer is:

SOLUTION

Binding refers to the linking of a procedure call to the code to be executed in response to the call.


Q. 190871 Define function.
Right Answer is:

SOLUTION

A function is a collection of statements that is grouped together to perform an operation.


Q. 190872 Name the type of binding which is done at the run time.
Right Answer is:

SOLUTION

Late Binding or Dynamic Binding


Q. 190873 Define the term function overload.
Right Answer is:

SOLUTION

Function overloading is the process of using the same name for two or more functions.


Q. 190874 Identify errors in the following code: [3] #include using namespace std; int fun(int x = 0, int y = 0, int z) { return (x + y + z); } int main() { cout << fun(10); return 0; }
Right Answer is:

SOLUTION

All default arguments must be the rightmost arguments. The following program works fine and produces 10 as output.

 

#include

using namespace std;

int fun(int x, int y = 0, int z = 0)

{ return (x + y + z); }

int main()

{

cout << fun(10);

return 0;

}


Q. 190875 What is function overloading? What are the points to be kept in mind while overloading a function?
Right Answer is:

SOLUTION

When the same function name has different definitions, it is known as function overloading. The definitions differ in the number and data types of the arguments.

Note:

The overloaded functions must have different arguments lists. Overloading functions with the same argument list but different return type is not allowed. Member functions cannot be overloaded by making one static and the other not, arguments being the same. There should be no ambiguity.


Q. 190876 Why function overloading is required in OOP?
Right Answer is:

SOLUTION

 


Q. 190877 Write a program in C++ to add two integer numbers and two double numbers with the help of function sum() to illustrate the concept of function overloading.
Right Answer is:

SOLUTION

// overloaded functions

#include

int sum (int a, int b)

{

return a+b;

}

double sum (double a, double b)

{

return a+b;

}

int main ()

{

cout << sum (10,20) <<“n”;

cout << sum (1.0,1.5) <<“n”;

return 0;

}


Q. 190878 What will happen when a function name is declared more than once in a program?
Right Answer is:

SOLUTION

When a function name is declared more than once in a program, the compiler interprets the declaration in following manner:

  1. Firstly, if the signatures of subsequent functions match the previous functions, then, the second function is treated as a re-declaration of the first.
  2. Secondly, if the signature of the two functions matches exactly but the return types differ, the second declaration is treated as an erroneous re-declaration of the first and flags error.
  3. Lastly, if the signatures of the two functions differ in either the number or type of their arguments, the two functions are considered to be overloaded.

 


Q. 190879 When both the relations are of the same degree and the domain of the attributes of both the relation is same, it is known as


A. intersection compatibility.

B. projection compatibility.

C. union compatibility.

D. selection compatibility.

Right Answer is: C

SOLUTION

The union compatibility is defined as such :
(1) the two relations have the same degree n (number of attributes) , and (2) domain (Ai) = domain (Bi) for 1<= i <=n, where domain stands for data type.


Q. 190880 The data stored at different levels should not affect each other when they get changed. It refers to


A. data integrity.

B. functional dependency.

C. referential integrity.

D. data independence.

Right Answer is: D

SOLUTION

Data independence is the type of data transparency that matters for a centralized DBMS. It refers to the immunity of user applications to make changes in the definition and organization of data, and vice-versa.


Q. 190881 The constraint, which is used to specify the value in the certain column, and must satisfy a Boolean expression, is


A. foreign key constraint.

B. check constraint.

C. table constraint.

D. unique key constraint.

Right Answer is: B

SOLUTION

A check constraint is the most generic constraint type. The value in certain column should satisfy a truth-value expression. There is no limit to the number of check constraints that one can define on a column.


Q. 190882 The size of database is usually measured in terms of


A. terabytes.

B. megabytes.

C. gigabytes.

D. databytes.

Right Answer is: C

SOLUTION

The size of database is measured in gigabytes. Gigabyte is a multiple of the unit byte for digital information storage. Since the giga prefix means 109, gigabyte means 1,000,000,000 bytes (10003, 109).


Q. 190883 The ability to modify the conceptual scheme without causing changes in the scheme at view level is known as


A. logical data independence.

B. view modification.

C. conceptual modification.

D. physical data independence.

Right Answer is: A

SOLUTION

The logical data independence ensures that the application program remains the same. Modifications at the conceptual level are necessary whenever a logical structure of the data gets altered.


Q. 190884 The ability to modify the scheme at physical level without affecting the scheme at conceptual level is known as


A. logical modification.

B. physical data independence.

C. physical modification.

D. logical data independence.

Right Answer is: B

SOLUTION

In physical data independence, the application programs remain the same even though the scheme at physical level gets modified. This is done in order to improve the performance of the system.


Q. 190885 One of the disadvantages of the database system is that its


A. integrity is not maintained.

B. hardware configuration cost is high.

C. data redundancy is increased.

D. durability decreases.

Right Answer is: B

SOLUTION

Cost of hardware is one of the most important things for a database system. Its hardware configuration cost is high.


Q. 190886 The person responsible for the security and functioning of the database is


A. database administrator.

B. end user.

C. security officer.

D. programmer.

Right Answer is: A

SOLUTION

DBA is a person who checks the authenticity of the database. He insures the database is secure and functioning properly.


Q. 190887 The command used to remove the whole table is


A. alter.

B. drop.

C. delete.

D. insert into.

Right Answer is: B

SOLUTION

DROP TABLE table_name; is the command used to remove the table.We should not get confuse with delete command, as delete is use to delete some rows.


Q. 190888 The function, which is used to combine related tuples from two relations, is


A. intersection.

B. add.

C. join.

D. projection.

Right Answer is: C

SOLUTION

In the simplest form the join operation is just the cross product of two relations. Two interrelated tuples from two different relations are joined by this function.


Q. 190889 The relation in which each non-key attribute is non transitively dependent on the entire key is


A. 1NF.

B. 2NF.

C. 3NF.

D. 4NF.

Right Answer is: C

SOLUTION

A table is said to be in 3NF, if it is in 2NF and transitively dependency is removed from the table.


Q. 190890 The relation in which each non-key attribute is functionally dependent on the entire key is


A. 1NF.

B. 2NF.

C. 3NF.

D. 5NF.

Right Answer is: B

SOLUTION

A table is said to be in 2NF, if it is in 1NF and all non-key attributes are totally dependent upon primary key.


Q. 190891 The relation in which no two rows are identical and each table entry is single valued is


A. 1NF.

B. 2NF.

C. 3NF.

D. 5NF.

Right Answer is: A

SOLUTION

1NF is used to remove the redundancy in the system. Therefore, delicacy and repetition of values is not allowed.


Q. 190892 The rule which states the value of primary key can never be a null value is


A. a referential integrity.

B. an entity integrity.

C. a data integrity.

D. a null integrity.

Right Answer is: B

SOLUTION

Primary key is a key, which uniquely identifies, a specific instance of an entity. Therefore, the value of the primary key can never be null.


Q. 190893 The command used in creating and maintaining the database is


A. DML.

B. DDL.

C. DCL.

D. TCL.

Right Answer is: B

SOLUTION

DDL stands for data definition language. It provides statement for creating and deleting the database.


Q. 190894 What is the difference between an array and a stack implemented as an array?
A. DML.
B. DDL.
C. DCL.
D. TCL.

Right Answer is:

SOLUTION

Elements of an array can be accessed and processed in any order.

In a stack, data can be inserted (push) and deleted (pop) at one end, called the top.  These are the only operations possible in a stack. Stack is a LIFO structure where the element that comes last must be removed first. 


Q. 190895 Write the algorithm for adding the integer NUM to each element in the linked list?
A. DML.
B. DDL.
C. DCL.
D. TCL.

Right Answer is:

SOLUTION

1.  SET  X = Start

2.  REPEAT STEPS 3 to 4 UNTIL X = NULL

3.  X->info = X->info + NUM

4.  X = X->next

5.  END                          

 


Q. 190896 How is the linked implementation of stack different from implementation as an array?
A. DML.
B. DDL.
C. DCL.
D. TCL.

Right Answer is:

SOLUTION

When the stack is implemented as an array, there is a limited size beyond which it cannot store elements.  Trying to push when the stack is full would give an error ‘Overflow’.  In case of linked implementation, whenever an element is to be stored a new node is created in memory. 


Q. 190897 Write the algorithm for counting the number of non-zero values in a linked list.
A. DML.
B. DDL.
C. DCL.
D. TCL.

Right Answer is:

SOLUTION

1.  SET  X = Start

2.  SET num = 0

3.  REPEAT STEPS 4 to 6 UNTIL X = NULL

4.  IF  X->info !=0 THEN

5.      num = num + 1

6.      X = X->next

7.      PRINT “Number of Non Zero values”, num

8.  END                                

         

 


Q. 190898 Write the algorithm for locating an element, EL, in a linked list.
A. DML.
B. DDL.
C. DCL.
D. TCL.

Right Answer is:

SOLUTION

1.  SET  X = Start

2.  SET P = NULL

3.  REPEAT STEPS 4 to 7 UNTIL X = NULL

4.  IF EL = X->info THEN

5.      {P = X

6.         Go To 8 }

7.      X = X->next

8.     IF P = NULL THEN

            PRINT “Not Found”

       ELSE

            PRINT “Found At “, P

9.  END                                                                   


Q. 190899 What is a queue?  What are the operations performed on a queue?
A. DML.
B. DDL.
C. DCL.
D. TCL.

Right Answer is:

SOLUTION

Queue is a FIFO (First In First Out) structure. This means that elements that enter the queue first, leave it first.  All insertions are at the rear end and deletions are at the front end.  The value of front and rear are maintained to keep track of these operations. 

A queue can be visualized as queue of people waiting to buy a ticket. A queue can be implemented as an array or a linked list.   

 

 


Q. 190900 What is meant by ‘Overflow’ and ‘Underflow’ ?
A. DML.
B. DDL.
C. DCL.
D. TCL.

Right Answer is:

SOLUTION

Overflow is a situation that occurs when we try to insert a value in an array when there is no space available. This situation is faced in stacks or queues.  Once the available space is occupied or full, any attempt to push or insert, arises the ‘Overflow’ condition.

Underflow occurs when we try to extract or remove a value when there are none. Any attempt to extract from an empty list in stack or queue, implemented as array, arises ‘Underflow’ condition.       


PreviousNext