Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

CS301 Solved MCQs - CS301 Solved Online Quizzes - CS301 Solved MCQs Bank - CS301 MCQs Collection from Online Quizzes – CS301 Mega Solved MCQs – CS301 Mid Term Final Term Papers Solved MCQs

CS301 Solved MCQs - CS301 Solved Online Quizzes - CS301 Solved MCQs Bank - CS301 MCQs Collection from Online Quizzes – CS301 Mega Solved MCQs – CS301 Mid Term Final Term Papers Solved MCQs

CS301 Virtual University MCQs BANK - MCQs Collection from Online Quizzes

Question # 1 of 10 ( Start time: 11:21:05 PM )  Total M - 1  
Local variables of a function are stored in,  
Select correct option:  
 Binary Search Tree  
 Stack 
 Queue  
 AVL Tree 
     
Question # 2 of 10 ( Start time: 11:21:39 PM )  Total M - 1  
Compiler uses which one of the following in Function calls,  
Select correct option:  
 Stack  
 Queue  
 Binary Search Tree 
 AVL Tree 
     
Question # 3 of 10 ( Start time: 11:23:09 PM )  Total M - 1  
A queue is a ________data structure, whereas a stack is a ________data structure.  
Select correct option:  
 FIFO, LIFO     
 LIFO,FIFO 
 both of these 
 none of these 
     
Question # 4 of 10 ( Start time: 11:24:21 PM )  Total M - 1  
Which data structure allows deleting data elements from front and inserting at rear?  
Select correct option:  
 Stacks  
 Queues  
 Deques  
 Binary search tree 
     
Question # 5 of 10 ( Start time: 11:25:49 PM )  Total M - 1  
In__________ the ‘next’ returns false when it reaches to the last node due to the fact that the next field of the last node is set to NULL.  
Select correct option:  
 Circular linked list 
 Triple linked list 
 Singly linked list 
 None of the above
     
Question # 6 of 10 ( Start time: 11:26:12 PM )  Total M - 1  
What will be postfix expression of the following infix expression? Infix Expression : a+b*c-d  
Select correct option:  
 ab+c*d- 
 abc*+d- 
 abcd+*- 
 abc+*d- 
     
Question # 7 of 10 ( Start time: 11:27:40 PM )  Total M - 1  
Which of the following is NOT a linear data structure?  
Select correct option:  
 Linked List 
 Stack 
 Queue 
 Tree 
Question # 8 of 10 ( Start time: 11:28:38 PM )  Total M - 1  
The next field in the last node in a singly-linked list is set to_______.  
Select correct option:  
 0
 1
 NULL 
 false 
     
Question # 9 of 10 ( Start time: 11:29:16 PM )  Total M - 1  
A kind of expressions where the operator is present between two operands called ________expressions.  
Select correct option:  
 Infix 
 Postfix 
 Prefix 
 None of the above
"+" is ____ operator.
 unary
 binary

Views: 1285

Replies to This Discussion

CS301 Data Structures Solved MCQs



For a perfect binary tree of height 4. What will be the sum of heights of nodes?
31

30

27
26

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)


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

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)

We can build a heap in _____ time.

Linear
Exponential
Polynomial
None of the given options

 we can build a heap in linear time using n calls of percolate_down()


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

55
51
50
49 N-1= 49 

CS301 MCQs 

In threaded binary tree, the NULL pointers are replaced by the
Select correct option:
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
Select correct option:
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 _____
Select correct option:
2
3
4
6
 
See the below code and fill the appropriate answer for? void fastInorder(TreeNode* p) { while((p=nexInorder(p)) != ? ) cout<getinfo(); }<="" span=""></getinfo();>
Select correct option:
dummy
rootNode
LTH
RTH
 
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)
 
Which of the following statement is not correct about Binary Trees, where binary tree traversals are carried out repeatedly?
Select correct option:
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 _________
Select correct option:
Iteration
Recursion
Both recursion and iteration
None of the given options
If the bottom level of a binary tree is NOT completely filled, depicts that the tree is NOT a -------
Select correct option:
Complete Binary tree
Threaded binary tree
Expression tree
Perfectly complete Binary tree
 
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 of the following statement is true about dummy node of threaded binary tree?
Select correct option:
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?
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
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.
Select correct option:
left most
root
right most
any of the given node
Abinary 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 ________
Select correct option:
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?
Select correct option:
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

CS301- Data Structure-Current-Solved-MCQs

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

Preorder
Inorder
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.
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.
Preoder
Inorder
Postorder
Levelorder 

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 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 tree
Binary tree
Complete binary Tree
None of these

 

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

44
45
46
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
Complete 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+1
N+2

 

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

Dummy
rootNode
LTH
RTH

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

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

Left to right
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 ________

Complete Binary tree
Threaded Binary Tree
Expression tree
Perfectly 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 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
Completely
Incompletely
Partly 

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 

An expression tree will always be a,
Complete binary tree
Binary search tree
Heap AVL 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 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

 

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.

 

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.

 

A complete binary tree is a tree that is _________ filled, with the possible exception of the bottom level.
partially
completely
incompletely
partly

 

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

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-1
2i
2i+1
floor(i/2) 

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

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

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 

Consider a binary tree, represented by the following array: 10,7,9,5,2,1,6,3,4 This is a ________.
Min heap
Max 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 
No 

In threaded binary tree the NULL pointers are replaced by the
preorder successor or predecessor
inorder successor or predecessor
inorder successor or predecessor
NULL 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?
Yes
No 

We implement the heap by ______________ .
Threaded Tree
AVL tree
Complete binary 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
        57

 

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 complete binary tree the bottom level is filled from ________.

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

 

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.
True
Flase

 

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

insert
add
update
preculateDown

CS301 MCQs

For a perfect binary tree of height 4. What will be the sum of heights of nodes?
Select correct option:
31
30
27
26
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
Heap can be used to implement
Select correct option:
Stack
Linked list
Queue
Priority Queue
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
improve performance
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
A binary relation R over S is called an equivalence relation if it has following property(s)
Select correct option:
Reflexivity
Symmetry
Transitivity
All 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
Which one of the following is NOT the property of equivalence relation?
Select correct option:
Reflexive
Symmetric  
Transitive
Associative  
Which one of the following is NOT the property of equivalence relation?
Select correct option:
Reflexive
Symmetric  
Transitive
Associative  
If a tree has 20 edges/links, then the total number of nodes in the tree will be :
Select correct option:
19
20
21
Can't be determined
If Ahmed is cousin of Ali and Ali is cousin of Asad then Ahmed is also cousin of Asad. This statement has the following property
Select correct option:
Reflexivity
Symmetry
Transitivity
All of the above 

CS301 Data Structures MCQs

CS301 Question # 1 of 15
In threaded binary tree, the NULL pointers are replaced by the
Select correct option:
preorder successor or predecessor
inorder successor or predecessor
postorder successor or predecessor
NULL pointers are not replaced
 
 
CS301 Question # 2 of 15
If one pointer of the node in a binary tree is NULL then it will be a/an
Select correct option:
Inner node
Leaf node
External node
Root node
  
CS301 Question # 3 of 15
When a complete binary tree represented by an array then if right child is at position 5 then left child will be at position _____
Select correct option:
2
3
4
6

https://vustudents.ning.com/

CS301 Question # 4 of 15
See the below code and fill the appropriate answer for? void fastInorder(TreeNode* p) { while((p=nexInorder(p)) != ? ) cout p->getInfo(); }
Select correct option:
dummy
rootNode
LTH
RTH
 
CS301 Question # 5 of 15 
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)
 
CS301 Question # 6 of 15 
Which of the following statement is not correct about Binary Trees, where binary tree traversals are carried out repeatedly?
Select correct option:
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.
 

https://vustudents.ning.com/

CS301 Question # 7 of 15
Traversing a binary tree can only be done using _________
Select correct option:
Iteration
Recursion
Both recursion and iteration
None of the given options
 
CS301 Question # 8 of 15 
If the bottom level of a binary tree is NOT completely filled, depicts that the tree is NOT a ----------
Select correct option:
Complete Binary tree
Threaded binary tree
Expression tree
Perfectly complete Binary tree
 
CS301 Question # 9 of 15 ( Start time: 09:18:27 PM )Total M - 1
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.
 
CS301 Question # 10 of 15
Which of the following statement is true about dummy node of threaded binary tree?
Select correct option:
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.

https://vustudents.ning.com/ 

CS301 Question # 11 of 15 
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
 
CS301 Question # 12 of 15
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.
Select correct option:
left most
root
right most
any of the given node
CS301 Question # 13 of 15
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
 
 
CS301 Question # 14 of 15
In complete binary tree the bottom level is filled from ________
Select correct option:
Left to right
Right to left
Not filled at all
None of the given options
 
CS301 Question # 15 of 15 
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?
Select correct option:
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

RSS

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service