CS301 Data Structure Online Solved MCQ's Quizzes File 1



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

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,15,16,17,8,4,3540,30,20,10,35,16,17,8,4,1540,35,20,10,30,16,17,8,4,1540,35,20,10,15,16,17,18,4,30

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.
PreorderInorderPostorderLeveloder

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 nodesA 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 2N links, N+1 links to internal nodes and N-1 links to external nodes.

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.PreoderInorderPostorderLevelorder 


Which one of the following is NOT the property of equivalence relation?
Select correct option:
Reflexive
Symmetric
Transitive
Associative 

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


If MyClass has a destructor what is the destructor named?
·       MyClass
·       ~MyClass
·       My~Class
·       MyClass~
·        
·       Class abc{ ----- }; Is a valid class declaration?
·       yes
·       no
·        
·       Without using Deep copy constructor, A ____________ problem can occur
·       System crash
·       Memory Leakage
·       Dangling pointer
·       All of the given
·       If only one behaviour of a derived class is incompatible with base class, then it is:
·       Generalization
·       Specialization
·       Extension
·       Inheritance
·        
·       Which of the following may not be an integral part of an object?
·       state
·       behavior
·       Protected data members
·       All of given
·        
·       Only tangible things can be chosen as an object.
·       True
·       False
·       Class is not a mechanism to create objects and define user data types.
·       true
·       false
·      
Memory is allocated to non static members only, when:
·       Class is created
·       Object is defined
·       Object is initialized
·       Object is created
·      
The sub-object’s life is not dependent on the life of master class in ___________.
·       Composition
·       Aggregation
·       Separation

·       non of the given

 Vukwl- Virtual Education Solution


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

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 PREORDER 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 treeBinary treeComplete binary TreeNone of these

A binary tree with 45 internal nodes has _________ links to external nodes.
44454690 

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

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

Question No: 1    ( M - 1 )    .
A subscript of an array may be an integer or an integer expression.
► True
► False
Question No: 2    ( M - 1 )    .
Doubly Linked List always has one NULL pointer.

► True
► False
Question No: 3    ( M - 1 )    .

In which of the traversal method, the recursive calls can be used to traverse a binary tree  ?
►  In preorder traversal only
►  In inorder traversal only
►  In postorder traversal only
►  All of the given options
Question No: 4    ( M - 1 )    .
A tree is an AVL tree if 

► Any one node fulfills the AVL condition
► At least half of the nodes fulfill the AVL condition
► All the nodes fulfill the AVL condition
► None of the given options
Question No: 5    ( M - 1 )    .
Suppose currentNode refers to a node in a linked list (using the Node class with member variables called data and nextNode). What boolean expression will be true when cursor refers to the tail node of the list?

► (currentNode == null)
► (currentNode->nextNode == null)
► (nextNode.data == null)
► (currentNode.data == 0.0)
Question No: 6    ( M - 1 )    - Please choose one
Suppose that the class declaration of SomeClass includes the following function prototype.
bool LessThan( SomeClass anotherObject );
Which of the following tests in the client code correctly compares two class objects alpha and beta?

► if (alpha < beta)
► if (alpha.LessThan(beta))
► if (LessThan(alpha, beta))
► if (LessThan(alpha).beta)

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 

Question No: 7    ( M - 1 )    .
In C what is the operation that you can not do with primitive types?
► Assign a value to primitive type using a literal
► Declare primitive types to be constant using the Const keyword
► Create a new instance of primitive type with New keyword
► None of these
Question No: 8    ( M - 1 )    .
The operation for adding an entry to a stack is traditionally called :      
► add
► append
► insert
► push

Question No: 10    ( M - 1 )    .
Consider the following sequence of push operations in a stack:      
stack.push(’7’);
stack.push(’8’);
stack.push(’9’);
stack.push(’10’);
stack.push(’11’);
stack.push(’12’);

► 7 8 9 10 11 12
► 9 8 11 10 7 12
► 9 10 8 11 12 7
► 9 10 8 12 7 11
Question No: 11    ( M - 1 )    .
________ is the maximum number of nodes that you can have on a stack-linked list ?
► Zero
► 2n (where n is the number of nodes in linked list)
► Any Number
► None of these

The data of the problem is of 2GB and the hard disk is of 1GB capacity, to solve this problem we should
► Use better data structures
► Increase the hard disk space
► Use the better algorithm
► Use as much data as we can store on the hard disk
Question No: 12    ( M - 1 )    .
Which of the following can be used to reverse a string value,

► Stack

► Queue

► Both of these

► None of these

Question # 8 of 10 ( Start time: 01:17:52 AM ) Total M a r k s: 1
·       Which one is not an object association?
·       Select correct option:
·       Simple association
·       Inheritance
·       Aggregation
·       Association
·        
·       Using encapsulation we can achieve
·       Select correct option:
·       Information hiding
·       Least interdependencies among modules
·       Implementation independence
·       All of given options
·        
·       In constant member function the type of this pointer is:
·       Select correct option:
·       Constant pointer
·       Constant pointer to object
·       Constant pointer to class
·       Constant pointer to constant object
·        
·       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?
·       Generalization
·       Sub-typing
·       Specialization
·       Extension
·        
·       The ability to derive a class from more than one class is called
·       Single inheritance
·       Encapsulation
·       Multiple inheritance
·       Polymorphism

Heap can be used to implement
Select correct option:
Stack
Linked list
Queue
Priority 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
1,4,3,7,5,10,6



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.

 Vukwl- Virtual Education Solution



Suppose there are a set of fruits and a set of vegetables. Both sets are ______________ sets.
Select correct option:
Disjoint 
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.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


If one pointer of the nodes in a binary tree is NULL then it will be a/an
Inner nodeLeaf nodeExternal nodeRoot 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-1NN+1N+2

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

In threaded binary tree, the NULL pointer are replaced by the.Preorder successor or PredecessorInorder successor or predecessorPostorder successor or predecessorNULL pointer are not replaced 
In which of the following tree, parent nodes has a key greater than or equal to its both children?
Max heapBinary search treeThreaded Binary threeComplete Binary tree 
In Complete binary tree the bottom level is filled from _______.
Left to rightRight to leftNot filled at allNone of the given options

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 :
55
51
50
49 N-1= 49 



Suppose we are sorting an array of eight integers using quick sort, and we have just finished the first partitioning with the array looking like this:
2 5 1 7 9 12 11 10
Which statement is correct?
► The pivot could be either the 7 or the 9.
► The pivot could be the 7, but it is not the 9.
► The pivot is not the 7, but it could be the 9.
► Neither the 7 nor the 9 is the pivot. (the pivot value will be 1 or 5)

Question No: 6      ( M - 1 ) .

When should you use a const reference parameter?
       ► Whenever the parameter has huge size.
       ► Whenever the parameter has huge size, the function changes the parameter within its body, and you do NOT want these changes to alter the actual argument.
       ► Whenever the parameter has huge size, the function changes the parameter within its body, and you DO want these changes to alter the actual argument.
Which one of the following algorithms is least efficient,
► Quick Sort
► Insertion Sort
► Merge Sort
► Bubble Sort (NOT Confirmed)
Mergesort makes two recursive calls. Which statement is true after these recursive calls finish, but before the merge step?
► Elements in the first half of the array are less than or equal to elements in the second half of the array.
► None of the given options.
► The array elements form a heap.
► Elements in the second half of the array are less than or equal to elements in the first half of the array.


If the bottom level of a binary tree is NOT completely filled, depicts that the tree is NOT a ________
Complete Binary treeThreaded Binary TreeExpression treePerfectly compete Binary tree 
If an expression tree is correct then its root should have,
An operator()an operand

In threaded binary tree, the NULL pointers are replaced by the.
Preorder successor or predecessorInorder successor or predecessorPostorder successor or predecessorNULL pointer are not replaced 
A complete binary tree is a tree that is ________ filled, with the possible exception of the bottom level.
PartiallyCompletelyIncompletelyPartly 
If the bottom level of a binary tree is not completely filled, depicts that the tree is not a _________.
Expression treeThreaded binary treeComplete binary treePerfectly complete binary tree 

An expression tree will always be a,Complete binary treeBinary search treeHeap AVL tree 

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




In threaded binary tree the NULL pointers are replaced by thepreorder successor or predecessorinorder successor or predecessorinorder successor or predecessorNULL pointers are not replaced 
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?YesNo 
We implement the heap by ______________ .Threaded TreeAVL treeComplete binary treeExpression 
If there are 56 internal nodes in a binary tree then how many external nodes this binary tree will have?
   
       ► 54
       ► 55       ► 56        57

Which of the following features of OOP is used to derive a class from another?
·       Select correct option:
·       Encapsulation
·       Polymorphism
·       Data hiding
·       Inheritance
·        
·       Which of the following is a weak relationship between two objects?
·       Select correct option:
·       Inheritance
·       Composition
·       Aggregation
·       None of given
·        
·       Data items in a class must be private.
·       Select correct option:
·       True
·       False
·        
·       Which one is a class association?
·       Select correct option:
·       Simple Association
·       Inheritance
·       Composition
·       Aggregation
·        
·       Suppose there is an object of type Person, which of the following can be considered as one of its attributes
·       Select correct option:
·       Name
·       Age
·       Work()

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.         A binary tree with N internal nodes has N+1 external nodes.        ► None of above statement is a property of the binary tree.  
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 internal nodes has N+ 1 external 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.

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. 
If the bottom level of a binary tree is NOT completely filled, depicts that the tree is NOT a   
       ► Expression tree
       ► Threaded binary tree       ► complete Binary tree       ► Perfectly complete Binary tree

 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. 

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        22
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 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 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 successor.
 
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        Threaded binary tree        Heap data structure        Huffman encoding

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 case of deleting a node from AVL tree, rotation could be prolong to the root node.        Yes        No

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

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

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


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


If one pointers of the node in a binary tree are NULL then it will be a/an _______ .
► Inner node
► Leaf node
► Root node
► None of the given options

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



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)



Question No: 8      ( M - 1 ) .
 What is the maximum depth of recursive calls a function may make?
       ► 1
       ► 2
       ► n (where n is the argument)
       ► There is no fixed maximum

Question No: 9      ( M - 1 ) .
 Suppose n is the number of nodes in a complete Binary Tree then maximum steps required for a search operation are,
       ► Log2 (n+1) -1
       ► Log2 (n+1)
       ► Log2 (n) – 1
       ► Log2 (n)


Question No: 10      ( M - 1 ) .

In the linked list implementation of the stack class, where does the push member function places the new entry on the linked list?
       ► At the head
       ► At the tail
       ► After all other entries that are greater than the new entry.
       ► After all other entries that are smaller than the new entry.

Question No: 11      ( M - 1 ) .

Suppose we have a circular array implementation of the queue class, with ten items in the queue stored at data[2] through data[11]. The CAPACITY is 42, i.e., the array has been declared to be of size 42. Where does the push member function place the new entry in the array?
       ► data[1]
       ► data[2]
       ► data[11]
       ► data[12]

Question No: 12      ( M - 1 ) .

The expression AB+C*  is called ?
       ► Prefix expression
       ► Postfix expression
       ► Infix expression
       ► None of these
Question No: 13      ( M - 1 ) .

_________ is a binary tree where every node has a value, every node's left subtree contains only values less than or equal to the node's value, and every node's right subtree contains only values that are greater then or equal ?                                                                    
       ► Strictly Binary Tree
       ► Binary Search tree
       ► AVL tree
       ► All of these

Question No: 14      ( M - 1 ) .

Consider the following binary search tree (BST):
If node A in the BST is deleted, which two nodes are the candidates to take its place?
       ► J and I
       ► H and E
       ► D and E
       ► L and M


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




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



If one pointer of the node in a binary tree is NULL then it will be a/an

Inner node
Leaf node
External node
Root node
 

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
6

Question No: 1    ( M - 1 )    .
 Which one of the following is a valid postfix expression?
       ► ab+c*d-
       ► abc*+d-
       ► abc+*d-
       ► (abc*)+d-
   
Question No: 2    ( M - 1 )    .
 The tree data structure is a 
       ► Linear data structure
       ► Non-linear data structure
       ► Graphical data structure
       ► Data structure like queue
   
Question No: 3    ( M - 1 )    .
 A Compound Data Structureis the data structure which can have multiple data items of same type or of different types. Which of the following can be considered compound data structure?
       ► Arrays
       ► LinkLists
       ► Binary Search Trees
       ► All of the given options



See the below code and fill the appropriate answer for? void fastInorder(TreeNode* p) { while((p=nexInorder(p)) != ? ) cout << p->getInfo(); }

dummy
rootNode
LTH
RTH


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)


Which of the following statement is not correct about Binary Trees, where binary tree traversals are carried out repeatedly?

The overhead of stack operations during recursive calls can be costly.
If we use non-recursive but stack driven traversal procedure then it would be costly again.
It is useful to modify the tree data structure which represents the binary tree to speed up the inorder traversal process by making it stack free.
It is very cumbersome to modify the tree data structure as most of pointer fields are not NULL.




Traversing a binary tree can only be done using _________

Iteration
Recursion
Both recursion and iteration
None of the given options

In programming, where the actual actions are coded is called:
Select correct option:

Function declaration
Function callingFunction definition
None of the given 
·       Which of the following is directly related to polymorphism?
Select correct option:
Overriding 
Const members
Static members
None of given
·        
·       In a class declaration, data or functions designated private are accessible
Select correct option:
to any function in the program.
only if you know the password.
to member functions of that class.  
only to public members of the class.  
·       An instance of user defined type is called
Select correct option:

ObjectClass
both of above
none of above 
·       Aggregation is implemented using pointer.
Select correct option:
TrueFalse
·        
cs301 mcqs solved cs301 quiz mega file cs301 midterm solved papers 2017 cs301 solved mcqs mega file cs301 midterm solved papers 2016 cs301 data structures midterm papers cs301 final term solved mcqs mega file cs301 handouts cs301 lectures cs301 assignment cs301 handouts cs301 assignment solution 2018 cs301 ppt slides cs301 assignment no 2 solution 2018 cs301 midterm solved papers by moaaz cs301 final term solved mcqs by moaaz
Previous Post Next Post