CS301 Data Structure Online Solved MCQ's Quizzes File 2

·        
·       If class A supports all the operations of class B, then class A is:
·       Class A is behaviourally compatible with class B
·       Class A is behaviourally incompatible with class B
·       Class A is independent of class B
·       None of the given


If the bottom level of a binary tree is NOT completely filled, depicts that the tree is NOT a ----------

Complete Binary tree
Threaded binary tree
Expression tree
Perfectly complete Binary tree


Finding the minimum is easy; it is _____ of the min heap.

Top
Left most child
Right most child
None of the given options.


Which of the following statement is true about dummy node of threaded binary tree?

This dummy node never has a value
This dummy node has always some dummy value
This dummy node has either no value or some dummy value.
This dummy node has always some integer value.



Consider a min heap, represented by the following array: 3,4,6,7,5,10 After inserting a node with value 1. Which of the following is the updated min heap?

3,4,6,7,5,10,1
3,4,6,7,5,1,10
1,4,6,7,5,10,3
1,4,3,7,5,10,6


For the inorder traversal of threaded binary tree, we introduced a dummy node. The left pointer of the dummy node is pointing to the ________ node of the tree.

left most
root
right most
any of the given node

A binary tree with N internal nodes has _____ links, _______ links to internal nodes and ________ links to external nodes.
Select correct option:
2N, N-1, N+1
N-1, 2N, N+1
N+1, 2N, N-1
N+1, N-1, 2N



In complete binary tree the bottom level is filled from ________

Left to right
Right to left
Not filled at all
None of the given options


Consider a max heap, represented by the following array: 40,30,20,10,15,16,17,8,4 After inserting a node with value 35.Which of the following is the updated max heap?

40,30,20,10,15,16,17,8,4,35
40,30,20,10,35,16,17,8,4,15
40,35,20,10,30,16,17,8,4,15
40,35,20,10,15,16,17,8,4,30



Consider a max heap, represented by the following array; 40,30,20,10,15,16,17,18,4 After inserting a nodes with value 35.Which of following is the updated max heap?
40,30,20,10,35,16,17,8,4,15
40,35,20,10,30,16,17,8,4,15
40,35,20,10,15,16,17,18,4,30

We can build a heap in _____ time.
Select correct option:
Linear 
Exponential
Polynomial
None of the given options

A Threaded Binary Tree is a binary tree in which every node that does not have a right child has a THREAD (in actual sense, a Link) ___________Successor.
Preorder
Postorder
Leveloder

Which of the following is a property of binary tree?
A Binary tree with N internal nodes has 2+N links, N-1 links to internal nodes and N+1 links to external nodes
A Binary tree with N internal nodes has 2*N links, N-1 links to internal nodes and N+1 links to external nodes.
A Binary tree with N internal nodes has 2-N links, N-1 links to internal nodes and N+1 links to external nodes.


If there are 56 internal nodes in a binary tree then how many external nodes this binary tree will have?
54
55
56

Which of the following statement is correct?
A threaded Binary tree is a binary tree in which every node that does not have a left child has a THREAD (in actual sense, a link) to its INORDER successor.
A threaded Binary tree is a binary tree in which every node that does not have a left child has a THREAD (in actual sense, a link) to its INORDER successor.
A threaded Binary tree is a binary tree in which every node that does not have a right child has a THREAD (in actual sense, a link) to its POSTORDER predecessor.

It is necessary fro Huffman encoding tree to be,
AVL tree
Complete binary 
Tree
None of these



A Threaded Binary tree is a binary tree in which every node that does not have a right child has a THREAD (in actual sense, a link)_____________ successor.
Preoder
Postorder
Levelorder 
A binary tree with 45 internal nodes has _________ links to external nodes.
44
45
90 

In which of the following tree, parent nodes has key greater than or equal to its both children?
Max heap
Binary search tree
Threaded Binary tree

If one pointer of the nodes in a binary tree is NULL then it will be a/an
Inner node
Leaf node
External node
Root node 

If there are N external nodes is a binary tree then what will be the no. of the internal nodes in this binary tree?
N-1
N
N+2

See the below code and fill the appropriate answer for? Void fastlnorder(TreeNod+p) {while((p+nextInorder(p)) !+ ? ) cout << p->getInfo();}
root
Node
LTHRTH

In threaded binary tree, the NULL pointer are replaced by the.
Preorder successor or Predecessor
Postorder successor or predecess
NULL pointer are not replaced 

The total number of nodes on 5th level of a perfect binary tree are :
Select correct option:
16
15
31


Which one of the following is NOT the property of equivalence relation?
Select correct option:
Reflexive
Symmetric
Transitive
given the values are the array representation of heap; 12 23 26 31 34 44 56 64 78 100 If we perform 4 deleteMin operations, the last element deleted is__________.
Select correct option:
34
44
56

 Vukwl- Virtual Education Solution


If we want to find median of 50 elements, then after applying buildHeap method, how many times deleteMin method will be called ?
Select correct option:
5
35
50

For a perfect binary tree of height 4. What will be the sum of heights of nodes?
Select correct option:
31
30
27

Heap can be used to implement
Select correct option:
Stack
Linked list
Queue

 Vukwl- Virtual Education Solution


Suppose there are 100 elements in an equivalence class, so initially there will be 100 trees. The collection of these trees is called ________________.
Select correct option:
Cluster
Class
Forest 
Bunch

Consider a min heap, represented by the following array: 3,4,6,7,5,10 After inserting a node with value Which of the following is the updated min heap?
Select correct option:
3,4,6,7,5,10,1
3,4,6,7,5,1,10
1,4,6,7,5,10,3


Finding the minimum is easy; it is _____ of the min heap.
Select correct option:
Left most child
Right most child
None of the given options.

 Vukwl- Virtual Education Solution


Suppose there are a set of fruits and a set of vegetables. Both sets are ______________ sets.
Select correct option:
Subsets
Whole
Equal

For a perfect binary tree of height 4. What will be the sum of heights of nodes?31
302726
For a perfect binary tree of height h, having N nodes, the sum of heights of nodes is _____________.
N – (h – 1)
N – (h + 1) 
N – 1
N – 1 + h

If we want to find median of 50 elements, then after applying buildHeap method, how many times deleteMin method will be called ?
5
25
35
50
Which of the following heap method increase the value of key at position ‘p’ by the amount ‘delta’?
increaseKey(p,delta) 
decreaseKey(p,delta)
preculateDown(p,delta)
remove(p,delta)

www.vuzs.info
The main reason of using heap in priority queue is
improve performance 
code is readable
less code
heap can't be used in priority queues

 Vukwl- Virtual Education Solution

The total number of nodes on 10th level of a perfect binary tree are :
256
512
1024
Can't be determined
Which property of equivalence relation is satisfied if we say: Ahmad R(is related to) Ahmad
Reflexivity
Symmetry 
Transitivity
All of the above

Which of the following heap method lowers the value of key at position ‘p’ by the amount ‘delta’?
increaseKey(p,delta) 
decreaseKey(p,delta)
preculateDown(p,delta)
remove(p,delta)

In case of deleting a node from AVL tree, rotation could be prolong to the root node.       
Yes       
No


We can build a heap in _____ time.
Linear 
Exponential
Polynomial
None of the given options

 Vukwl- Virtual Education Solution

If a tree has 50 nodes, then the total edges/links in the tree will be :

We are given N items to build a heap of items , this can be done with _____ successive inserts.
Select correct option:
N-1
N   
N+1
N^2

Which of the following is true regarding the maze generation?
Select correct option:

Randomly remove walls until the entrance and exit cells are in the same set

Removing a wall is the same as doing a union operation
Do not remove a randomly chosen wall if the cells it separates are already in the same set
All of the given 


 Vukwl- Virtual Education Solution


If a tree has 50 nodes, then the total edges/links in the tree will be :
Select correct option:
55
51
50
49 


Consider the code below, class c1{ }; class c2 : public c1 { }; class c3 : public c2 { }; Then c2 is, 
Direct base class of c3 
Direct child class of c3 
Direct base class of c1 
None of these
Virtual functions allow you to 
create an array of type pointer-to-base class that can hold pointers to derived classes. 
create functions that can never be accessed. 
group objects of different classes so they can all be accessed by the same function code. 
use the same function call to execute member functions of objects from different classes.
User can make virtual table explicitly. 
True 
False


The preculateDown procedure will move the smaller value____ and bigger value______.
Select correct option:
left,right
right,left
up,down
down,up 


If the height of a perfect binary tree is 4. What will be the total number of nodes in it?
Select correct option:
15
16 
31
32


Question # 6 of 10 ( Start time: 01:15:52 AM ) Total M - 1
Which one is a class association
Select correct option:
1.    Simple Association
2.    Inheritance
3.    Composition
4.    Aggregation
Question # 7 of 10 ( Start time: 01:16:55 AM ) Total M - 1
Suppose there is an object of type Person, which of the following can be considered as one of its attributes
Select correct option:
1.    Name
2.    Age
3.    Work()
4.    Both Name and Age



Question # 8 of 10 ( Start time: 01:17:52 AM ) Total M - 1
Which one is not an object association?
Select correct option:
1.    Simple association
2.    Inheritance
3.    Aggregation
4.    Association
Question # 9 of 10 ( Start time: 01:18:50 AM ) Total M - 1
Using encapsulation we can achieve
Select correct option:
1.    Information hiding
2.    Least interdependencies among modules
3.    Implementation independence
4.    All of given options
Question # 10 of 10 ( Start time: 01:19:43 AM ) Total M - 1
In constant member function the type of this pointer is:
Select correct option:
1.    Constant pointer
2.    Constant pointer to object
3.    Constant pointer to class
4.    Constant pointer to constant object
Question # 1 of 10
Which of the following is the way to extract common behavior and attributes from the given classes and make a separate class of those common behaviors and attributes?
1.    Generalization
2.    Sub-typing
3.    Specialization
4.    Extension

If we want to find 3rd minimum element from an array of elements, then after applying buildHeap method, how many times deleteMin method will be called ?
Select correct option:
1
2 
3
4


Which one of the following is NOT true regarding the skip list?
Select correct option:
Each list Si contains the special keys + infinity and - infinity
List S0 contains the keys of S in non-decreasing order
List Sh contains only the n special keys 
Each list is a subsequence of the previous one

 Vukwl- Virtual Education Solution


Target of a _____ function call is determined at run time.
instance 
virtual 
operator 
none of given
Consider the following statements: 1) int iArray[5]; 2) int *pArr = iArray; 
These statements will compile successfully 
Error in first statement 
Error in second statement 
None of given options
Consider the code below, class class1{ private: int i; }; class class2 : private class1 { }; Then int member i of class1 is ____ in class2, 
public 
protected 
private
none of the given options
If there is a pointer, p, to objects of a base class, and it contains the address of an object of a derived class, and both classes contain a virtual member function, ding(), then the statement p->ding(); will cause the version of ding() in the ___ class to be executed.
base 
derived 
virtual 
implemented
A class template may inherit from another class template. 
True 
False

Derived class can inherit from public base class as well as private and protected base classes 
True 
False


Which of the following heap method increase the value of key at position ‘p’ by the amount ‘delta’?
Select correct option:
increaseKey(p,delta)   
decreaseKey(p,delta)
preculateDown(p,delta)
remove(p,delta)


The total number of nodes on 10th level of a perfect binary tree are :
Select correct option:
256
512
1024 
Can't be determined





 Vukwl- Virtual Education Solution


Which of the following method is helpful in creating the heap at once?
Select correct option:
insert
add
update
preculateDown


Consider a max heap, represented by the following array; 40,30,20,10,15,16,17,18,4 After inserting a nodes with value 35.Which of following is the updated max heap?
40,30,20,10,35,16,17,8,4,15
40,35,20,10,30,16,17,8,4,15
40,35,20,10,15,16,17,18,4,30

We can build a heap in _____ time.
Select correct option:
Linear 
Exponential
Polynomial
None of the given options

A Threaded Binary Tree is a binary tree in which every node that does not have a right child has a THREAD (in actual sense, a Link) ___________Successor.
Preorder
Postorder
Leveloder

Which of the following is a property of binary tree?
A Binary tree with N internal nodes has 2+N links, N-1 links to internal nodes and N+1 links to external nodes
A Binary tree with N internal nodes has 2*N links, N-1 links to internal nodes and N+1 links to external nodes.
A Binary tree with N internal nodes has 2-N links, N-1 links to internal nodes and N+1 links to external nodes.


If there are 56 internal nodes in a binary tree then how many external nodes this binary tree will have?
54
55
56
57

The default inheritance mode is, 
Public inheritance 
Protected inheritance 
Private inheritance 
None of these options

Two functions with same names, parameters and return type can exist in, 
Function overloading 
Function overriding 
Operator overloading 
None of these options

Which of the following statement is correct?
A threaded Binary tree is a binary tree in which every node that does not have a left child has a THREAD (in actual sense, a link) to its INORDER successor.
A threaded Binary tree is a binary tree in which every node that does not have a left child has a THREAD (in actual sense, a link) to its INORDER successor.
A threaded Binary tree is a binary tree in which every node that does not have a right child has a THREAD (in actual sense, a link) to its POSTORDER predecessor.

It is necessary fro Huffman encoding tree to be,
AVL tree
Complete binary 
Tree
None of these



A Threaded Binary tree is a binary tree in which every node that does not have a right child has a THREAD (in actual sense, a link)_____________ successor.
Preoder
Postorder
Levelorder 
A binary tree with 45 internal nodes has _________ links to external nodes.
44
45
90 

In which of the following tree, parent nodes has key greater than or equal to its both children?
Max heap
Binary search tree
Threaded Binary tree

If one pointer of the nodes in a binary tree is NULL then it will be a/an
Inner node
Leaf node
External node
Root node 

If there are N external nodes is a binary tree then what will be the no. of the internal nodes in this binary tree?
N-1
N
N+2

A template argument is preceded by the keyword__________.
Vector
Class
Template
Type* 
Friends are used exactly the same for template and non-template classes.
True
False 
A function template must have a parameter
True
False

Child class can call constructor of its,
Direct base class
Indirect base class
Both direct and indirect base classes
None of these.
 
Which statement will be true for concrete class?
It implements an virtual concept.
It can be instantiated
It cannot be instantiated
None of given

See the below code and fill the appropriate answer for? Void fastlnorder(TreeNod+p) {while((p+nextInorder(p)) !+ ? ) cout << p->getInfo();}
root
Node
LTHRTH

In threaded binary tree, the NULL pointer are replaced by the.
Preorder successor or Predecessor
Postorder successor or predecess
NULL pointer are not replaced 

Sorted sequentially array 
Stack 
Link list 
Skip list 

In which of the following tree, parent nodes has a key greater than or equal to its both children?
Max heap
Binary search tree
Threaded Binary three
Complete Binary tree 

In Complete binary tree the bottom level is filled from _______.
Right to left
Not filled at all
None of the given options

If the bottom level of a binary tree is NOT completely filled, depicts that the tree is NOT a ________
Threaded Binary Tree
Expression tree
Perfectly compete Binary tree 

If an expression tree is correct then its root should have,
()an operand

c++ dynamic binding and polymorphism will be achieved when member function will be __.
private 
public 
virtual 
inline
Consider the code below, class class1{ protected: void func1(); }; class class2 : public class1 { }; Function func1 of class1 is ____ in class2, 
public 
protected
private 
none of the given options
Consider the code below, class class1{ protected: int i; }; class class2 : protected class1 { }; Then int member i of class1 is ____ in class2, 
public 
protected 
private 
none of the given options

Consider the code below, class class1{ private: void func1(); }; class class2 : private class1 { }; Function func1 of class1 is ____ in class2, 
public 
protected 
private 
none of the given options
In threaded binary tree, the NULL pointers are replaced by the.
Preorder successor or predecessor
Inorder successor or predecessor
Postorder successor or predecessor
NULL pointer are not replaced 

A complete binary tree is a tree that is ________ filled, with the possible exception of the bottom level.
Partially
Incompletely
Partly 

Previous Post Next Post