0% found this document useful (0 votes)
388 views11 pages

CS301-P Mcqs FinalTerm by Vu Topper RM

Cs301 past paper
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
388 views11 pages

CS301-P Mcqs FinalTerm by Vu Topper RM

Cs301 past paper
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

CS301-P Data

Structures Practical
Update MCQ’S Final Term
Rizwan Manzoor
@vutopperrm Vu Topper RM

d
cc

For More Help Contact What’s app 03224021365


Question No:1 (Marks:1) Vu-Topper RM
If the data is given in sorted order, the tree generated will be similar
to__________.
A. Queue
B. Heap
C. Linked list
D. Stack

Question No:2 (Marks:1) Vu-Topper RM


If values 9,5,7 are used to build AVL tree then which type of rotation can
balance the AVL tree?
A. Double left-right
B. Double right left
C. Single right
D. Single left

Question No:3 (Marks:1) Vu-Topper RM


If values 10,20,15 are used to build AVL tree then which type of rotation
can balance the AVL tree?
A. Double left-right
B. Single left
C. Single right
D. Double right-left

Question No:4 (Marks:1) Vu-Topper RM


Which type of rotation can balance the following AVL tree?
A. Double right-left
B. Single left
C. Double left-right
D. Single right

For More Help Contact What’s app 03224021365


Question No:5 (Marks:1) Vu-Topper RM
Which method of Node class returns the value of node in a Linked list?
A. get()
B. back()
C. start()
D. tail()

Question No:6 (Marks:1) Vu-Topper RM


What does the following method do for a given linked list class?void
traverse(List list){Node* savedCurrentNode =
list.currentNode;list.currentNode = list.headNode;for(int i = 1;
list.next(); i++){cout << "\n Element " << i << " " << list.get(); }list.
currentNode = savedCurrentNode;}
A. Deleting nodes
B. Displaying the values of nodes
C. Adding new nodes
D. Updating the values of nodes

Question No:7 (Marks:1) Vu-Topper RM


Which operation is performed by the statement given below?Node *
newNode = new Node(18);
A. Creating a new node with object value 18
B. Calling constructor of List class
C. Creation of 18 nodes
D. Static Memory allocation for 18 nodes

Question No:8 (Marks:1) Vu-Topper RM


Which of the following statement declares an array ‘x’ with 6 integers?
A. int [6] x;
B. int x = 6;

For More Help Contact What’s app 03224021365


C. float x[6];
D. int x[6];

Question No:9 (Marks:1) Vu-Topper RM


What will be value of second element of array ‘x’ after the execution of
the given code?int main(){ int x[3]; for(int j = 0; j < 3; j++) x[j] = 2 * j;
return 0;}
A. 1
B. 2
C. 0
D. 4

Question No:10 (Marks:1) Vu-Topper RM


Nodes in the linked list are accessed in _________ order:
A. Non-linear
B. Sequential
C. Descending
D. Random

Question No:11 (Marks:1) Vu-Topper RM


The following method getLeft () of TreeNode class returns the
__________ to the left sub-tree. TreeNode * getLeft(){ return left;
}
A. Object
B. Pointer
C. Integer value
D. None of the given options

For More Help Contact What’s app 03224021365


Question No:12 (Marks:1) Vu-Topper RM
Which of the following queue does not always follow FIFO behavior?
A. Circular queue
B. Simple queue
C. Double-ended queue
D. Priority queue

Question No:13 (Marks:1) Vu-Topper RM


The ________ level of any leaf in a binary tree is called the depth of the
tree
A. Maximum
B. Mid
C. Zero
D. Minimum

Question No:14 (Marks:1) Vu-Topper RM


The depth of a complete binary tree is 6 , the number of its non-leaf
nodes will be:
A. 64
B. 6
C. 61
D. 63

Question No:15 (Marks:1) Vu-Topper RM


Which of the following are the leaf nodes in given tree?
A. 1,8,4
B. 1,5,8
C. 1,5,3
D. 1,8,3

For More Help Contact What’s app 03224021365


Question No:16 (Marks:1) Vu-Topper RM
If there is a complete binary tree of depth 4, the total number of nodes in
it will be:
A. 32
B. 31
C. 30
D. 33

Question No:17 (Marks:1) Vu-Topper RM


In a binary tree, level of root node is :
A. Same as the level of its left child
B. 0
C. 2
D. Same as the level of its right child

Question No:18 (Marks:1) Vu-Topper RM


In C++, a single stack can be used for different types by using
__________.
A. Templates
B. Postfix expressions
C. Linked Lists
D. Static variables

Question No:19 (Marks:1) Vu-Topper RM


What value will be returned by the given function if the values of ‘a’ and
‘b’ are 6 and 5?
int i_avg (int a, int b)
{
return (a++ + ++b) / 2;
}

For More Help Contact What’s app 03224021365


A. 4
B. 6
C. 5
D. 7

Question No:20 (Marks:1) Vu-Topper RM


Which of the following is used to navigate from one node to another
node in the linked list?
A. Next part of node
B. Object field of node
C. None of the given options
D. Null pointer

Question No:21 (Marks:1) Vu-Topper RM


Which of the following Linked List method moves the pointer forward?
A. next ()
B. add ()
C. start ()
D. remove ()

Question No:22 (Marks:1) Vu-Topper RM


Consider a list {2,6,8,7,1} represented as a linked list. In this list
“current” is a:
A. Head node
B. List element
C. List object
D. Pointer

For More Help Contact What’s app 03224021365


Question No:23 (Marks:1) Vu-Topper RM
When the call to remove a node is made, a node which is being pointed
by ______ will be deleted.
A. Null node
B. head Node
C. Last Current node
D. Current node

Question No:24 (Marks:1) Vu-Topper RM


What does the following method do for a given linked list class?
void traverse(List list)
{
Node* savedCurrentNode = list.currentNode;
list.currentNode = list.headNode;
for(int i = 1; list.next(); i++)
{cout << "\n Element " << i << " " << list.get(); }
list. currentNode = savedCurrentNode;
}
A. Displaying the values of nodes
B. Adding new nodes
C. Deleting nodes
D. Updating the values of nodes

Question No:25 (Marks:1) Vu-Topper RM


Which of the following is an infix expression?
A. +63
B. 826+*
C. 52+3*
D. (1+2) *(3+4)

For More Help Contact What’s app 03224021365


Question No:26 (Marks:1) Vu-Topper RM
Which type of linked list has two Null pointers?
A. Singly linked list
B. Doubly linked list
C. Circularly linked list
D. None of the given options

Question No:27 (Marks:1) Vu-Topper RM


In data structures, List is the collection of elements in ____________.
A. Non-linear order
B. Random order
C. Linear order
D. Descending order

Question No:28 (Marks:1) Vu-Topper RM


Removing an element from the end of stack using a linked list takes
________ time than removing an element from the start.
A. Less
B. No
C. Equal
D. More

Question No:29 (Marks:1) Vu-Topper RM


In Linked List, add () method will add the new node after ________.
A. head Node
B. None of the given option
C. Current node
D. Last Current node

For More Help Contact What’s app 03224021365


Question No:30 (Marks:1) Vu-Topper RM
In a doubly linked list, we can traverse the list in _______________.
A. Both directions
B. Forward direction
C. No direction
D. Reverse direction

Question No:31 (Marks:1) Vu-Topper RM


If elements 2,4,6,8 are placed in a stack and are deleted one at a time, in
what order will they be removed?
A. 8,6,4,2
B. 2,8,6,4
C. 4,2,6,8
D. 2,4,6,8

Question No:32 (Marks:1) Vu-Topper RM


The stack will be considered full, if the current variable is equal to
______________.
A. Size +1
B. Size -1
C. Size
D. Size ++

Question No:33 (Marks:1) Vu-Topper RM


In the given stack what will be the head and top after removing node
with value 1?
A. 7
B. 5
C. 2
D. 7 and 5

For More Help Contact What’s app 03224021365


Visit My YouTube Channel
For Subjective and More
Important Files
Channel Name = #VuTopperRM

For More Help Contact What’s app 03224021365

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy