CS301 Data Structure Online Solved MCQ's Quizzes File 3



If the bottom level of a binary tree is not completely filled, depicts that the tree is not a _________.
Expression tree
Threaded binary tree
Perfectly complete binary tree 

An expression tree will always be a,
Complete binary tree
Heap AVL tree

Derived class can inherit from public base class as well as private and protected base classes
True
False 
Which line will produce error. Class phone: Private Transmit, private Receiver { } 1.int main () 2. { 3.phone obj; 4.Tranmit*obj1 = &obj; 5.Received obj2 = &obj; 6.}
3rd line will produce error
4th line will produce error
3rd and 4th line will produce error.
5th line will produce error. 
Methodologies to the development of reusable software relate to ____________.
Structure programming
Procedural programming
Generic programming
None of the given 

Which of the following is a property of binary tree?
A binary tree of N external nodes has N internal node
A Binary tree of N external nodes has N+1 internal nodeA Binary tree of N internal has N-1 external node 

In a threaded binary tree which nodes have NULL child pointers,
All leaf nodes
Nodes other then leaf nodes
Root Node
None of the nodes

A template provides a convenient way to make a family of.
variables and data members 
functions and classes 
classes and exceptions 
programs and algorithms
A class template may inherit from another class template.
True 

False
Target of a _____ function call is determined at run time.
instance
virtual 
operator
none of given
In threaded binary tree, the NULL pointers are replaced by the
preorder successor or predecessor
inorder successor or predecessor
postorder successor or predecessor
NULL pointers are not replaced

A complete binary tree is a tree that is _______ filled, with the possible exception of the bottom level.
partially
completely
incompletely
partly
Which one of the following is TRUE about iteration?
Iterative function calls consumes a lot of memory
Threaded Binary Trees use the concept of iteration
Iteration extensively uses stack memory
Recursion is more efficient than iteration

We implement the heap by ____________ .
Threaded Tree
AVL tree
Complete binary tree
Expression

Which of the following statement concerning heaps is NOT true?
Traversing a heap in order provides access to the data in numeric or alphabetical order.
Removing the item at the top provides immediate access to the key value with highest (or lowest) priority.
Inserting an item is always done at the end of the array, but requires maintaining the heap property.
A heap may be stored in an array.

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

The expression of (! heap-> is full() ) check
Heap is empty 
Heap is full 
Heap is not empty
Heap is not full(not conferm)

Which of the following statement concerning heaps is NOT true?
A heap can be stored in a binary search tree.
A heap can be stored in an array.
A heap can be used to implement a priority queue.
A heap can be used to sort data.



By using __________we avoid the recursive method of traversing a Tree, which makes use of stacks and consumes a lot of memory and time.
Binary tree only
Heap data structure
Huffman encoding 



Threaded binary tree
When a complete binary tree, represented by an array then for any array element at position i, the parent is at position ______ .
2i-12i
2i+1

When a complete binary tree represented by an array then if right child is at position 5 then left child will be at position _____
2
3
4

If a binary tree has N + 1 external nodes then,It has N internal nodes.
It has N-1 internal nodes.
It has N/2 internal nodes
.It has N+2 internal nodes. 

A binary tree with 45 internal nodes has _______links to external nodes.
44
45
46
90

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



In private inheritance derived class pointer can be assigned to base class pointer in.
Main function
 
In derived class member and friend functions 
In base class member and friend functions 
None of the given options
Which statement will be true for concrete class? 
it implements an virtual concept. 
it can be instantiated 
it cannot be instantiated 
none of given
Target of a _____ function call is determined at run time.
instance 
virtual 
operator 
none of given

The Specialization pattern after the name says that this specialization is to be used for every___.
data types 
meta types 
virtual types 
pointers type

A complete binary tree is a tree that is _________ filled, with the possible exception of the bottom level.
partially
incompletely
partly
Consider a binary tree, represented by the following array: 10,7,9,5,2,1,6,3,4 This is a ________.
Min heapMax heap 
(Not Sure)
Threaded binary tree
Binary Search tree
Consider a binary tree, represented by the following array: A,B,C,D,E,F,G,I Is it a strictly binary tree ?  
Yes

In threaded binary tree the NULL pointers are replaced by the
preorder successor or predecessor
inorder successor or predecessor
NULL pointers are not replaced

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
Methodologies to the development of reusable software relate to________. 
Structure programming 
procedural programming 
generic programming 
None of the given
Function template must have a parameter. 
True 
False

Consider a binary tree, represented by the following array: A,B,C,D,E,F,G,H,I,J,K,L Is it a strictly binary tree?
Yes

We implement the heap by ______________ .
Threaded Tree
AVL tree
Expression 

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 about find(x) operation: 
A find(x) on element x is performed by returning exactly the same node that is found.
A find(x) on element x is performed by returning the root of the tree containing x.        
A find(x) on element x is performed by returning the whole tree itself containing x.       
A find(x) on element x is performed by returning TRUE. 




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 right child has a THREAD (in actual sense, a link) to its PREOREDR 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 successor.

Two functions with same names, parameters and return type can exist in, 
Function overloading 
Function overriding 
Operator overloading 
None of these options
Consider the code below, class class1{ private: int i; }; class class2 : public class1 { }; Then int member i of class1 is ____ in class2, 
public 
protected 
private 
none of the given options
Target of a _____ function call is determined at run time.
instance 
virtual 
operator 
none of given
A class template may inherit from another class template.
True 
False

Which of the following statement is true about dummy node of threaded binary tree?       
The left pointer of dummy node points to the itself while the right pointer points to the root of tree. 
The left pointer of dummy node points to the root node of the tree while the right pointer is always NULL.       
The right pointer of dummy node points to the itself while the left pointer is always NULL. 

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


If there are 23 external nodes in a binary tree then what will be the no. of internal nodes in this binary tree?
 23       
 2       
 21      

A function call is resolved at run-time in_________ 
non-virtual member function 
virtual member function 
Both non-virtual member and virtual member function.
None of given
A class hierarchy 
shows the same relationships as an organization chart. 
describes “has a” relationships. 
describes “is a kind of” relationships. 
shows the same relationships as a family tree.
Consider the code below, class class1{ public: int i; }; class class2 : public class1 { }; Then int member i of class1 is ____ in class2, 
public 
protected 
private 
none of the given options
Consider the code below, class c1{ }; class c2 : public c1 { }; class c3 : public c2 { }; Then c1 is, 
Direct base class of c3 
Direct child class of c3 
Direct base class of c2 
Direct child class of c2

A class can inherit from more then one class is called.
Simple inheritance 
Multiple inheritances 
Single inheritance 
Double inheritance

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


Which of the following statements is correct property of binary trees? 

A binary tree with N internal nodes has N+1 internal links.        
A binary tree with N external nodes has 2N internal nodes.        
 None of above statement is a property of the binary tree.  
What is the best definition of a collision on a hash table?Two entries are identical except for their keys.
Two entries with different data have the exact same key.
Two entries with different keys have the exact has value
Two entries with the exact same keys have different hash value.

By using __________we avoid the recursive method of traversing a Tree, which makes use of stacks and consumes a lot of memory and time.
Binary tree only       
Heap data structure      
Huffman encoding


Which one of the following is not an open addressing technique to resolve collection
Quadratic probing
Double hashing
Cubic probing
Liner probing

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?
Select correct option:
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 

Consider a min heap, represented by the following array:
10,30,20,70,40,50,80,60
After inserting a node with value 31.Which of the following is the updated min heap?
10,30,20,31,40,50,80,60,70    10,30,20,70,40,50,80,60,31       
10,31,20,30,40,50,80,60,31       
31,10,30,20,70,40,50,80,60



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



Which of the following is NOT 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
None of the given 


 Vukwl- Virtual Education Solution


The main reason of using heap in priority queue is
Select correct option:
improve performance 
code is readable
less code
heap can't be used in priority queues


When an array of object is created dynamically then there is no way to provide parameterized constructors for array of objects.
Flase


The expression if ( ! heap->isEmpty() ) checks
Select correct option:
Heap is empty
Heap is full
Heap is not empty 
Not a valid expression


A class D can be derived from a class C, which is derived froma class B, which is derived from a class A
True
False

Adding a derived class to a base class requires fundamental changes to the base class.
True
False

A Class or class template can have member ___________ that are themselves templates.
Variable
Function
Objects
None of given

Which property of relation is satisdied if we say: Ahmad R(is related to)Ahmad
Reflexivity
Symmetry
Transitvity
All of the given

Which of the following statement is NOT correct regarding Table ADT?
Select correct option:
In a table, the type of information in columns may be different.
A table consists of several columns, known as entities
The row of a table is called a record.
A major use of table is in databases where we build and use tables for keeping information.


In c++ dynamic binding and polymorphism will be achieved when member function will be __.
private 
public 
virtual 
inline
In type in depended function template should be use where code and behavior must be identical. 
True 
False
Consider the code below, class class1{ protected: int i; }; class class2 : private class1 { }; Then int member i of class1 is ____ in class2, 
public 
protected 
private 
none of the given options

 Vukwl- Virtual Education Solution


Consider a min heap, represented by the following array: 11,22,33,44,55 After inserting a node with value 66.Which of the following is the updated min heap?
Select correct option:
11,22,33,44,55,66 
11,22,33,44,66,55
11,22,33,66,44,55
11,22,66,33,44,55


Which property of equivalence relation is satisfied if we say: Ahmad R(is related to) Ahmad
Select correct option:
Reflexivity 
Symmetry
Transitivity
All of the above


In Private Inheritance the public members of base class become __________ in derived class.
·       Public
·       Private
·       Protected
·       None of the given options
·        
·       Function overriding is done in context of,
·       Single class
·       Single derived class
·       Single base class
·       Derived and base classes
·        
·       Child class can call constructor of its,
·       Direct base class
·       Indirect base class
·       Both direct and indirect base classes
·       None of these
·        
·       Adding a derived class to a base class requires fundamental changes to the base class
·       True
·       False
·        
·       _______________ is automatically called when the object is created.
·       Member function
·       Object
·       Constructor
·       None of the given
·        
·       Inheritance is a way to
·       Organize data
·       Pass arguments to objects of classes
·       Add features to existing classes without rewriting them
·       Improved data-hiding and encapsulation
·        
·       Through interface we access object_____________.
·       States
·       Data members
·       Behaviour
·       None of the given

Which of the following is NOT an implementation of Table ADT?
Select correct option:
Sorted Sequential Array
Stack
Linked List
Skip List   


The expression if ( ! heap->isFull() ) check
Select correct option:
Heap is empty
Heap is full
Heap is not empty
Heap is not full 



 Vukwl- Virtual Education Solution


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



We implement the heap by ____________ 
Threaded Tree
AVL tree
Complete binary tree
Expression



Question # 4 of 10 ( Start time: 01:13:51 AM ) Total M - 1
Which of the following is a weak relationship between two objects?
Select correct option:
1.    Inheritance
2.    Composition
3.    Aggregation
4.    None of given
Question # 5 of 10 ( Start time: 01:14:56 AM ) Total M - 1
Data items in a class must be private.
Select correct option:
1.    True
2.    False

A simple sorting algorithm like selection sort or bubble sort has a worst-case of
O(1) time because all lists take the same amount of time to sort
O(n) time because it has to perform n swaps to order the list.
O(n2) time because sorting 1 element takes O(n) time - After 1 pass through the list,
either of these algorithms can guarantee that 1 element is sorted.

O(n3) time, because the worst case has really random input which takes longer to.


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

25
35
50



 Vukwl- Virtual Education Solution




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


Which of the following is not true regarding the maze generation?
 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. 
 Remove a randomly chosen wall if the cells it separates are already in the same set. 
 Do not remove a randomly chosen wall if the cells it separates are already in the same set. 


Which property of equivalence relation is satisfied if we say: Ahmad R(is related to) Ahmad
Reflexivity
Symmetry
Transitivity



The expression if ( ! heap->isEmpty() ) checks
Heap is empty
Heap is full
Heap is not empty
Not a valid expression (not confirm)




We implement the heap by
Threaded Tree
AVL tree
Complete binary tree
Expression


Which of the following statement concerning heaps is NOT true?
Traversing a heap in order provides access to the data in numeric or alphabetical order.
Removing the item at the top provides immediate access to the key value with highest (or lowest) priority.
Inserting an item is always done at the end of the array, but requires maintaining the heap property.
A heap may be stored in an array.


Which property of relation is satisdied if we say: Ahmad R(is related to)Ahmad

 Vukwl- Virtual Education Solution


Reflexivity
Symmetry
Transitvity
All of the given

Which of the following statement is true about dummy node of threaded binary tree?
The left pointer of dummy node points to the itself while the right pointer points to the root of tree.
The left pointer of dummy node points to the root node of the tree while the right pointer points itself i.e. to dummy node.
The left pointer of dummy node points to the root node of the tree while the right pointer is always NULL.The right pointer of dummy node points to the itself while the left pointer is always NULL. 


Heap can be use to implement

Stack
Link list
Queue
Priority Queue



Which one of the following is not true regarding skip list.


Each list Si contain the special key + infinity and –infinity
List SO contain the key of S is non-decreasing order
Each list in a sub sequence of previous list one 


If Ahmad is cousin of Ali and Ali is cousin of Asad then Ahmad is also cousin of Asad
the statement has the following property.


Reflexivity
Symmetry
Transitivity
All of the above






Which one of the following is not the property of equivalence relation


Reflexive
Symmetric
Transitive
Associative


 Vukwl- Virtual Education Solution


Which of the following is not and implementation of table ADT
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:
31 
34
44
56

The worst case of building a heap of N keys is _______ .
Select correct option:
N
N^2
NlogN 
2^N

What is the best definition of a collision on a hash table?

 Vukwl- Virtual Education Solution


Two entries are identical except for their keys.

Two entries with different data have the exact same key.


Two entries with different keys have the exact has value

Two entries with the exact same keys have different hash value.



For a perfect binary tree of height h, having N nodes, the sum of heights of nodes is _____________.
Select correct option:
N – (h – 1)
N – (h + 1) 
N – 1
N – 1 + h


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



Which will be the Primary task or tasks of generic programming?
Categorize the abstractions in a domain into concepts
Implement generic algorithms based on the concepts
Build concrete models of the concepts
All of given

The default inheritance mode is,
Public inheritance
Protected Inheritance
Private Inheritance
None of these 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

 Vukwl- Virtual Education Solution


given the values are the array representation of heap; 12 23 26 31 34 44 56 64 78 100 What is the 5th smallest element in the given heap?
Select correct option:
31
34 
44
56


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


If there are 100 elements in an equivalence class then we will have _________ sets initially.
Select correct option:
50
100 
1000
80


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


A class hierarchy .
shows the same relationships as an organization chart.
describes “has a” relationships. 
describes “is a kind of” relationships. 
shows the same relationships as a family tree.
Sender of the message does not need to know the exact class of receiver in______.
Abstraction 
Polymorphism 
Inheritance 
none of the given
A function call is resolved at run-time in_________ .
non-virtual member function 
virtual member function 
Both non-virtual member and virtual member function. 
None of given
Adding a derived class to a base class requires fundamental changes to the base class.
True
False


 Vukwl- Virtual Education Solution


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

Which of the following is a property of binary tree?       
A binary tree of N external nodes has N internal node.       
A binary tree of N external nodes has N+ 1 internal node.       
A binary tree of N internal nodes has N- 1 external node.



 Vukwl- Virtual Education Solution


Which property of equivalence relation is satisfied if we say: Ahmad R(is related to) Ahmad
Select correct option:
Reflexivity 
Symmetry
Transitivity
All of the above


The preculateDown procedure will move the smallervalue____ and bigger value______.
Select correct option:

left,right
right,left
up,down
down,up

There are _________cases of Rotation in AVLtree.

Select correct option:

2
3
4
5
Templates automatically create different versions of a function, depending on user input.
True

False
________ Binding means that target function for a call is selected at run time
Automatic
Dynamic
Static
Dramatic
When we create objects, then space is allocated to:
Member function
Access specifier
Data member
None of given
There is only one form of copy constructor.
True
False 
Which of the following features of OOP is used to deal with only relevant details?
Abstraction
Information hiding
Object



In case of insertion of right inner node in BST,
Select correct option:
we need to apply single left rotation to make it AVL tree.
we need to apply single right rotationto make it AVL tree.
single left rotation first and then single right rotation tomake it AVL tree.
single right rotation first and then single left

Binary Search Tree voilates the condition of AVL tree when anynode has balance equal to
Select correct option:
2 or -2
1 or -1
0
None of the options.

Suppose we have the following values to be inserted inconstructing AVL tree, 20,23,25,10,12,13 Tell when first rotationwill take place,
Select correct option:
after inserting node 25
after inserting node 23
after inserting node 10
after inserting node 12

A binary relation R over S is called an equivalence relation if it has following property(s)

Reflexivity
Symmetry 
Transitivity 
All of the given options

The preculateDown procedure will move the smaller value____ and bigger value______.
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?


15 
16 
31
32 

Which one of the following is NOT the property of equivalence relation?
Reflexive
Symmetric 
Transitive 
Associative 

Which of the following heap method lowers 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) 

 Vukwl- Virtual Education Solution

heap can be used to implement 
stack 
linked list 
queue
priorty queue

which of following method is helpful in creating heap at once
insert 
add 
pecular down 
update



Which of the following is NOT 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.
Remove a randomly chosen wall if the cells it separates are already in the same set
Do not remove a randomly chosen wall if the cells it separates are already in the same set.


 Vukwl-Virtual Education Solution



Which of the following is NOT 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
None of the given


Suppose there is an image segmented into pixels. Each pixel has _________ neighbour(s).
Select correct option:
0
4 
8
16


 Vukwl- Virtual Education Solution


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


Which property of equivalence relation is satisfied if we say: Ahmad R(is related to) Ahmad
Select correct option:
Reflexivity 
Symmetry
Transitivity
All of the above


A complete binary tree of height 3 has between ________nodes.
Select correct option:
8 to 14
8 to 15
8 to 16
8 to 17



Which of the following method is helpful in creating the heap at once?
insertaddupdate

___________ Binding means that targets function for a call is selected at compile time.
Static
Dynamic
Automatic
None of given 
A Class hierarchy
Shows the same relationships as an organization chart
Describes “has a” relationships.
Describes “is a kind of” relationships.
Shows the same relationships as a family tree 
In C++, we declare a function virtual by preceding the function header with keyword “Inline”.
True
False 
It is illegal to make objects of one class members of another class.
True
False 

In Resolution order compiler search firstly____________.
Generic Template
Partial Specification
Complete Specification
Ordinary function

The expression if ( ! heap->isEmpty() ) checks
Heap is empty
Heap is full
Heap is not empty
Not a valid expression (not confirm)
We implement the heap by

given the values are the array representation of heap; 12 23 26 31 34 44 56 64 78 100 What is the 5th smallest element in the given heap?
Select correct option:
31
34 
44
56


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

Post a Comment

Previous Post Next Post