0% found this document useful (0 votes)
233 views45 pages

Cs301 Midterm Solved Mcqs by Junaid Malik

Uploaded by

Tayyba
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)
233 views45 pages

Cs301 Midterm Solved Mcqs by Junaid Malik

Uploaded by

Tayyba
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/ 45

CS301- DATA STRUCTURE

(SOLVED MCQs)
FROM MIDTERM PAPERS
LECTURE (1-22)

ajtechinstitute24@gmail. For More Visit: vujunaid.com JUNAID MALIK (0304-


com 1659294)
ÂL-JÛÑÂÎD TÊCH
JOIN OUR GROUP FOR MORE UPDATE
Click Button

CS619 & CS519 ÂL-JÛÑÂÎD TÊCH

1. Each node in singly link list has


1 pointer
2 pointers
3 pointers
4 pointers
2. Parameters in function call are passed using,
Stack
Queue
Binary Search Tree
AVL Tree
3. linked list is always contains elements that can be described as;
Redundant
Recursive
Self-referential
Bidirectional
4. The……. method of list data structure removes the element residing at the current
position.
Add
Next
Remove
Find
5. One deference between a queue and a stack is:
Queues require dynamic memory, but stacks do not
Stacks require dynamic memory, but queues do not
ÂL-JÛÑÂÎD TÊCH
Queues use two ends of the structure; stacks use only one
Stacks use two ends of the structure; queues use only one
6. Insertion in a linked list can be done at,
Front only
Back only
Somewhere in middle only
Front, back and somewhere in the middle
7. An array is a group of……..memory locations.
Scattered
Isolated
Random(non-consecutive)
Consecutive
8. Which of the following applications may use a stack?
Accessing shared resource
Parentheses balancing program
Buffering messages
Waiting list
9. Every AVL is……………
Ternary Tree
Complete Binary Tree
Heap
Binary Search Tree
10. Consider the following infix expression:
x - y * a+b/c
Which of the following is a correct equivalent expression for the above?
x y -a*b+c/
x *y a – b c/+
x y a* - b c /+
xya*-b/+c
ÂL-JÛÑÂÎD TÊCH
11. Consider the following infix
expression. 7/8+9
If one converts the above expression into postfix, what would be the resultant expression?
789/+
78/+9
/78+9
78/9+
12. Suppose there are 100 elements in an equivalence classes so initially there will be 100
tree.The collection of tree is called…….
Cluster
Class
Forest
Bunch
13. For a perfect binary tree of height h, having N nodes the sum of height of nodes is
N-h-1
N-1
N-1+h
-(h-1)
14. Sorting procedure normally takes………time
N log N
2N
N*N*N
N
15. there are 100 elements in an equivalence class then will have …………..state initially
50
100
1000
80
16. …………… objects (objects accessed by pointers) are called anonymous objects.
Private
Nameless
Friend
Public
17. ……….. is a self-balancing tree.
AVL
Binary Tree
Binary Search Tree
ALV
18. Which of the following operation returns but do not removes top value of the stack?
Push
Pop
Top
First
19. Int htdiff = height(root->getLeft())………. height(root-
>getRight()); The above line of code is taken from AVL insert
method.
ÂL-JÛÑÂÎD TÊCH
Complete it by selecting an appropriate symbol.
-
+
/
*
20. Which operation of the queue data structure is used to insert an element into the Queue?
Enqueue()
Dequeue()
Fornt()
Remove()
21. For making binary search tree for strings we need, ………. data type.
Char
Int
Float
Double
22. Local variables defined inside function body are ………..automatically at the end of
function execution.
Created
Destroyed
Incremented
Decremented
23. If a node has three fields, then this node will be related to
Linked list
Doubly linked list
Circular linked list
All of the given
24. …………is an area in computer memory that is allocated dynamically.
Heap
Stack
Queue
Linked list
25. Linked list use………to store data.
Array
2-D Array
Variables
Linked Memory
26. The lifetime of a transient object cannot exceed that of the application.
True
False
In some cases
None of the given
27. To represent hierarchical relationship between elements, which data structure is suitable?
Dequeue
Priority
ÂL-JÛÑÂÎD TÊCH Stack
Tree
28. Local variables of a function are stored in,
Binary search tree
Stack
Queue
AVL tree
29. In-order traversal method traverses the data in
Non sorted order
Random order
Sorted order
None of the given
30. Dequeue() operation of queue data structure is used to………
Get an element from the front of the queue
Remove an element from the front and return it
Insert an element at the front
Insert an element at the back
31. In a tree, we link the nodes in such a way that it……….a linear structure.
Does not remain
Forms
Reverses
Remains
32. Factorial is an example of………….function.
Recursive
Non-recursive
Cube
Log
33. All the objects created using………..operator have to be explicitly destroyed using
delete operator.
New
Delete
Del
Create
34. In the calling function, after the execution of the function called, the program
continues its execution from the………after the function call.
Previous line
Next line
Beginning
None of the above
35. Last node in circular linked list contains
At least one null pointer
No null pointer
Maximum two null pointers
None of the given
ÂL-JÛÑÂÎD TÊCH
36. One should be careful about transient……….that are stored by reference in data
structures.
Objects
Stack
Function
Tree
37. Binary search tree violates the condition of AVL tree when any node has balance equal to
2 or -2
1 or -1
0
None of the options
38. Security of data is the main usage of AVL tree.
True
False
In some cases
None of the given
39. A binary tree whose every node has either zero or two children is called _________.
Complete binary tree
Binary search tree
Strictly binary tree
None of above
40. In internal memory organization of a process, there is some area of memory for static
data that holds………..variables.
a. Static
b. Global
c. Not static neither global
d. Both static and global
41. Following is true in case of using recursive method calls.
The code becomes very long
There is no effect on length of code
The code becomes very short
Code becomes very easy to understand
42. In which 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
43. If we use doubly linked list to implement list then there is an issue of
Next pointer of first node and pre pointer of last node are NULL
Next pointer of first node and next pointer of last node are NULL
Pre pointer of first node and next pointer of last node are NULL
Pre pointer of first node and pre pointer of last node are NULL
44. In case of insertion of left outer node in BST,
We apply single right rotation to make it AVL tree.
ÂL-JÛÑÂÎD TÊCH We apply single left rotation to make it AVL tree.
We first apply right rotation and then left rotation to make it AVL tree.
We first apply left rotation and then right rotation to make it AVL tree.
45. Whenever we call a function, the complier makes a stack, the top element of the stack
is………..
of the function.
First argument
Return address
Last argument
None of the above
46. Suppose a stack class has been defined using template. Now, we want to declare a Stack
object of an int type. What will be the correct syntax?
<int>Stack stack;
Stack<int> stack;
Stack int stack;
Int Stack stack;
47. In node class one field is an integer data and other field will be………….
Pointer to class
Pointer to node
Pointer to integer
d. None of given options
48. If there are 100,0000 unique members (nodes) stored in a complete binary tree, the
tree will have………….levels.
10
20
30
40
49. ~Binary Search Tree () is a………
Constructor
Destructor
Switch case
Template method call
50. ……………is utilized at the time of memory allocation in dynamic manner.
Stack
Queue
Heap
All of the given
51. How many cases of rotation are there in AVL tree?
2
4
6
8
52. A list is the collection of items of the………..
May be of same or may be of different type
ÂL-JÛÑÂÎD TÊCH Different type
Same type
None of the above
53. Int * i = new
int[10]; Above
given code will:
Create an integer having value 10
Allocate memory for 9 integers
Allocate memory for 10 integers
Create 10 pointers of integer type
54. The depth of a binary tree is
Total number of nodes in the tree
Number of leaf nodes in the tree
Number of non-leaf nodes in the tree
Maximum level of a leaf
55. A………….model attempts to model a real-world phenomenon
Physical
Logical
Simulation
Conceptual
56. In level-order traversal for binary search tree, we visit the nodes at each level before
proceeding to the next level, in a…….order.
Right-to-left
Left-to-right
Top-to-bottom
Bottom-to-top
57. The balance of a node in a binary tree is defined as the height of its………..sub tree
minus height of its right sub tree.
Right
Left
Upper
Lower
58. Allocating and de-allocating memory for linked list nodes does take…………time
than pre-allocated array.
Less
More
Equal
No
59. Consider we have performed the following operations on a stack of
size 5. Push(10);
Push(20);
Push(30);
Pop();
ÂL-JÛÑÂÎD TÊCH
Pop();
Pop();
Push(40);
Push(50);
Pop();
After the completion of all operation, the top element in stack is _______.
10
20
40
50
60. In doubly linked list a node consists of three parts:
1 pointer and 2 objects
2 pointers and 1 object
3 objects
3 pointers
61. For reference variables, ________ sign is used.
a. Ampersand
b. Asterisk
c. Sigma
d. Dollar
62. Which of the following data structure is linear type?
Stack
List
Queue
All of the above
63. The - - is a decrement operator in C++ that decreases the value of the operand by ______.
One
Two
Three
Four
64. Which of the following statement is correct for the variable “current- -“?
Current = current + 1
Current = current - 1
Current = current - 2
Current – 1 = current
65. When an executable program runs, it is loaded in the computer memory and becomes a
_______.
Thread
b. .h file
c. Process
d. None of the above
66. start() method of list class is used to:
Moves the “current” pointer to very first element
Moves the “current” pointer to very last element
ÂL-JÛÑÂÎD TÊCH Moves the “current” pointer to one step after the first element of the array
Moves the “current” pointer to one step before the first element of the
array
67. a * (b + c) – d is an example of _______ expression.

Infix
Prefix
Postfix
Alfix
68. In a program a reference variable, say x, can be declared as
int &x;
int *x;
int x;
none of the given options
69. We allocate memory dynamically by using ______ operator.
This
New
Increment
d. Decrement
70. Get(?) method of list class is used to:
Get element from the last position
Get element from the first position
Get element from the middle position
Get element at the given position
71. STL is a _______ that is a part of the official standard of C++.
C program file
b. .h file
c. .cpp file
d. Library
72. There are ____ cases for deleting a node from binary search tree.
1
2
3
4
73. In a list, tail() method of current pointer ________
Returns the last element of the “current” pointer
Moves the “current” pointer to the very first element
Moves the “current” pointer to the very last element
Returns the first element of the “current” pointer
74. Suppose we have been given the following data set for a queue:
37524
What will be the resultant queue if we call a front() method?
7524
37524
ÂL-JÛÑÂÎD TÊCH 75243
524
75. Suppose we have been given the following data set for a queue:
7524
What will be the resultant queue if we call enqueue(3) method?
Note that 7 is the front element whereas 4 is rear element of
queue.
7524
37524
75243
5243
76. Maximum time that an insertion operation can take in AVL tree is _______. Here log
stands for log to the base of 2.
Log (n)
1.44 log (n)
1.66 log (n)
Log (n+1)
77. _______ is when function is calling to itself.
Loop
b. Recursion
c. Iteration
d. Nested loop
78. Left, right, info, and parent are the operations of ________ data structure.
Stack
Tree
Queue
Linked list
79. Following is a keyword of C++
Del
Delete
Remove
Eliminate
80. The expression DE+H* is called ______
Prefix expression
Infix expression
Postfix expression
Hybrid expression
81. A software solution is said to be efficient if it solves the problem __________.
By using some extra resources
Within no time

By consuming more hardware resources


ÂL-JÛÑÂÎD TÊCH Within its resources constraints
82. Each node in a singly linked list contains two fields, one field called data field while
other field contains:
Pointer to an integer
Pointer to character
Pointer to next node
Pointer to class
83. Each node in singly linked list contains _______
One pointer
Two pointers
No pointer
NULL pointer
84. Every AVL tree is a binary search tree.
True
False
Not in some cases
None of the given
85. In singly linked list “next” field of node contains:
Address of next node
Object of next node
Object of current node
Address of head node
86. Two common models of simulation are _____ and _____.
Circuit-based simulation and Event- based simulation
Circuit-based simulation and Time-based simulation
Time-based simulation and Event- based simulation
None of the above
87. What are the basic things associated with data structures?
Space for each data item it stores
Time to perform each basic operation
Programming effort
All of the above
88. In AVL tree insertion occurs on the inside in case ____ and 3 which a single rotation
cannot fix.
1
2
4
5
89. add(12) method of linked list class will
Add 12 nodes in linked list
Add 12 pointers in linked list
Add 12 as value in linked list
Add 12 values in linked list
90. Which of the following is a non- linear data structure?
ÂL-JÛÑÂÎD TÊCH Stack
Queue
Tree
Linked list
91. Which data structure allows deleting data elements from front anf inserting at rear?
Stacks
Queues
Deques
Binary search tree
92. Array cells are ____ in computer memory.
Contiguous
Random
Store in multiple Variables
Store in multiple functions
93. A kind of expression where the operator is present between two operands called
____expressions.
Infix
Postfix
c. Prefix
d. None of the above
94. back() method of list class is used to
Moves the "current" pointer to backward one element.
Moves the "current" pointer to backward two element.
Moves the "current" pointer to backward three element.
Moves the "current" pointer to backward four element.
95. next() method of List class is used to:
Moves the Current position backward one element
Moves the "Current" pointer to two steps after the last element of the array
Moves the Current position forward one element
Moves the "Current" pointer to two steps before the last element of the
array
96. _________tree has been named after two persons Adelson-Velskii and Landis.
Binary
Black
AVL
VLA
97. There are four cases of rotation in an _______ tree.
ELV
EVL
AVL
ALV
98. _______ is used for reference variable in C++.
!
@
ÂL-JÛÑÂÎD TÊCH #
&
99. A _______ is a tree in which every level, except possibly the last, is completely
filled, and all nodes are as far left as possible.
Strict binary tree
Full binary tree
Perfect binary tree
Complete binary tree
100. A queue is a data structure where elements are
Inserted at the front and removed from the back
Inserted and removed from the top
Inserted at the back and removed from the front
Inserted and removed from both ends
101. Longest path from root node to farthest leaf node is called _______ of tree.
Level
Length
Depth
Node level
102. New items are added at the ______ of the stack.
a. Bottom
b. Middle
c. Center
d. Top
103. Length() method of list class is used to:
Return the length of the array
Return the length of the list
Return the length of empty part of the array
Return the length of empty part of the list
104. The function calls are made with the help of ________.
Stack
Heap
Dynamic memory
External memory
105. An efficient program execute faster and helps in _____ the usage of resources
like memory and disk
Maximizing
Minimizing
Equalizing
None of the given
106. Generalized code written for a class is called:
Function
Template
Structure
Stack
ÂL-JÛÑÂÎD TÊCH
107. "set()" method of list class is used to:
Set the value of Pointer
Set the value of Null Nodes
Set the value of objects
Set the value of Value
108. In C++, we place the class interface in ___ file.
a. .cpp
b. .cppp
c. .h
d. .hh
109. Every _____ tree is a binary search tree.
AVL
binary
big
small
110. If both left and right nodes of a node are NULL then this type of node is called
____ node.
Non leaf
internal
inner
d. leaf
111. Which of the following function don’t belongs to the stack class?
push()
pop()
crash()
top()
112. For a complete binary tree, the depth is calculated as____
log2(number of nodes+1)-1
log2(number of nodes*1)+1
log2(number of nodes-1)-1
log2(number of nodes-1)+1
113. ___ only removes items in reverse order as they were entered
Queue
Stack
Both of these
None of these
114. What will be the postfix expression of following infix expression? D+E*F/G
DE*F/G
DE+F*G/
DEF*/+
DE+FG*/
115. The ______ of a node in a binary tree is defined as the height of its ________
sub tree minus height of its right sub tree.
Height
ÂL-JÛÑÂÎD TÊCH Balance
Width
None
116. The back() method decreases the value of Variable current by____
Four
Three
Two
One
117. In doubly linked list there is/are………pointer/s in each node.
One
Two
Three
Four
118. Suppose we have the following values to be inserted in constructing AVL tree,
10, 13, 15, 5, 7, 8
Tell when first rotation will take place.
a. After inserting node 13
b. After inserting node 15
c. After inserting node 5
d. After inserting node 7
119. Binary search algorithm cannot be applied to ___
Sorted linked list
sorted binary trees
sorted linear array
None of given option
120. During the execution of a process operating system constructs focus things
for that process which of the following is not part of that process
A section for static data including global variable
Stack
Heap
Linked list
121. Which one of the following method does not change the original value of the
argument in the calling function?
Call by passing reference of the argument
Call by passing the address of the argument
Call by passing the value of the argument
None of the given options
122. _____ is the major factor to see the efficiency of a program.
Quality
Time
Correctness
None of the given
123. While implementing stack with an array and to achieve LIFO behavior, we used
push and pop elements at ______.
ÂL-JÛÑÂÎD TÊCH The start of the array
The end of the array
The mid of the array
At least one position before array starting index.
124. A template is a function or class that is written with a ________
Specific
Definite
Generic
None of the above

125. In the linked list implementation of the stack class, where does the push
member function places the new entry on the linked list?
After all other entries that are greater than the new entry
At the head
After all other entries that are smaller than the new entry
At the tail
126. The next field in the last node in a singly-linked list is set to ________.
0
1
NULL
False
127. Consider the linked list having data [6, 72, 35, 65,25] stored in it. While current
pointer is pointing memory location having 72 stored in it. After calling remove()
function on the following linked list current point will point to memory location having
value?
6
35
65
25
128. If we write functions for recursive and non recursive inorder traversal method
of BST, what will be the difference between its functions prototypes?
Different return types
Different function names
Different arguments list
Nothing will be different
129. In singly linked list a node comprises of _________ field/s.
One
Two
Three
Four
130. Doubly linked list always has ______ NULL pointers in a node.
One
Two
Three
ÂL-JÛÑÂÎD TÊCH Four
131. A BST generated from the data in ascending order is ________.
Linear
Nonlinear
Balanced
Un sorted
132. Linked list is generally considered an example of _______ type of memory
location.
Static
Compile time
Dynamic
None of given options
133. What’s wrong with following loop?
while((i < 10) && (i > 24)){
}
a. The logical operator && cannot be used in a test condition
b. The while loop is an exit-condition loop
c. The test condition is always false
d. The test condition is always true
134. Making the tree unbalanced, it violates the ______ rule.
Linked list
Stack
AVL
Queue
135. copy() method of list data structure _________
copy first item of list
set one list to be a copy of another
copy last item of list
copy any item of list
136. Deleting a ______ node in BST is a ______ case.
Root, simplest
Left child, simplest
Right child, simplest
Leaf, simplest
137. We can not remove items randomly from ________
Stack
Queue
Both of these
None of these
138. NULL is an invalid address and ________.
Accessible
Inaccessible
Points to the start point of the list
Points to the last point of the list
ÂL-JÛÑÂÎD TÊCH
139. A stack carries _______ behavior.
FIFO
LIFO
AVCO
FEFO
140. The tree data structure is a
Linear data structure
Non-linear data structure
Graphical data structure
Data structure like queue
141. Can we store elements with different data types in a single array?
Yes
No
In some cases
None of given
142. The lifetime of a transient object can exceed that of application which is accessing
it.
True
False
In some cases
None of the given
143. In a complete binary tree, for 25000 nodes the depth will be _______.
13
14
c. 15
d. 16
144. The smallest value element in a binary search tree(Each node with left and right
pointer)
lies at
Root Node
Left Child of Root
Right Most Node
Left Most Node
145. if we use array to implement list, then there is an issue that is gives difficulty
when
We will access values randomly
We will remove data from it
We will increase its size
We will decrease its size
146. if there are ___ nodes in an avl tree its levels will be roughly as log2(10 million)
100 million
10 million
5 million
ÂL-JÛÑÂÎD TÊCH
2 million
147. Which one is the correct function call for the following function of
calculatincube?
int cube(int&num)
{
.
.
.
a. Cube(&num)
b. Cube(&&num)
c. Cube(*num)
d. Cube(num)
148. Which of the following is the correct option for priority Queue?
The type of Queue that is not FIFO i.e the person who comes first may not
leave first
The type of Queue that is not FIFO i.e the person who comes first should
leave first
The type of Queue that is not FIFO i.e the person who comes first should
leave first
The type of Queue that is not FIFO i.e the person who comes first may not
leave first
149. For String-based Binary Search Tree, We use ASCII values of characters for
comparing among letters. This method is known as ___
Lexicographic order
Alphabet coding procedure
Asymmetric technique
heap-based approach
150. Elements in a queue data structure are added from___ and remove from___ .
Rear end. front end
Front end. Rear end
Front end
rear end
151. If numbers 5,222,4,48 are inserted in a queue. Which one will be remove first?
i. 48
ii. 4
iii. 222
iv. 5
152. A zigzag rotation is performed. In Left-Left case of rotation in AVL tree.
i. True
ii. False
iii. In some cases
iv. None of the above
ÂL-JÛÑÂÎD TÊCH
153. During deletion of node from BST. if we found this node don't have in- order
successor and predecessor. it means this node is____
i. Left Most node in the binary search tree
ii. Right most node in the binary search tree
iii. Root node
iv. None of the given option
154. _____ rule applies for evaluating operators of same precedence in an expression
i. right to left
ii. Cascading
iii. Associative
iv. None of the above
155. What will be result of following postfix expression?
23*+2–
i. 3
ii. 4
iii. 5
iv. 10
156. y = &x[0];
In the above statement, we get the address of the fist location of the array x and store it in
y.
Here “y” is:
a. rvalue
b. xvalue
c. lvalue
d. zvalue
157. what will be postfix expression of the following infix
expression? Infix expression a+b*c-d
ab+c*d-
abc*+d-
abcd+*-
d. abc+*d-
158. Which of the following is the correct conversion of infix to postfix
expression? Z+B-(D-H)/K
ZB+D-H-K/
ZB+DH-K-/
ZB+DH-K/-
ZB+DHK--/
159. Leaf node of binary search tree contains…………
One null pointer
Three null pointers
Two null pointers
All of the given
160. A tree is an AVL tree if
Any one node ful fills tha AVL condition
ÂL-JÛÑÂÎD TÊCH At least half of the nodes fulfill the AVL condition
All the nodes fulfill the AVL condition
None of the given options
161. The…………of a binary tree is the maximum level of its leaves (also called the
depth).
Level
Width
Height
None of the above
162. Memory address is stored in
Address operator
Reference
Pointer
All of the given
163. A binary tree is said to be a…………..binary tree if every non-leaf node in a
binary tree has non-empty left and right sub trees.
Complete
Strictly
AVL
Perfect
164. “+” is a……………..operator.
Unary
Binary
Ternary
None of the above
165. Which of the following a nonlinear tree
a. Stack
b. Que
c. Tree
d. Linked List

166. For every Process execute the last part of the Memory is for………of the Program
a. Data
b. Code
c. Stack
d. Heap
167. While implement non recursive traversal for binary search tree we need to
implement________
a. Que
b. Stack
c. Min heap
d. Max Heap
168. Suppose we have the following values to be inserted in constructing AVL tree,
20,23,25,10, 12,13
ÂL-JÛÑÂÎD TÊCH
Tell when first rotation will take place.
a. After increasing Node 25
b. After increasing Node 23
c. After increasing Node 10
d. After increasing Node 12
169. If a tree has a 50 Node then the total linked in the tree will be
a. 55
b. 51
c. 50
d. 49
170. The percolate down procedure will move the smaller value ___and Bigger
value___
a. Left, right
b. Right, left
c. Down, up
d. Up, down

171. Circular Linked List Solve the problem of pointer/method of the doubly link list.
a) Remove
b) Null
c) Add
d) Find
172. isEmpty() method of stack class will return true when.
a) Stack is full
b) Stack is Partially
c) Stack is not empty or Null
d) Stack is empty
173. “New int[11]” will allocate memory for integers.
a) 13
b) 12
c) 11
d) 10

174. For searching a particular number in Binary Search Tree (if it is not present), the
maximum number of comparisons will be ________ comparison at each level.
a) 1
b) 2
c) 3
d) 4
175. In singly linked list which node will keep track of starting position of the list.

a) Next Node
b) Previous Node
c) Head Node
d) Last Node
176. If we singly linked list to implement list, then there is an issue that it gives
difficulty when we:
ÂL-JÛÑÂÎD TÊCH
a) Move forward in the list
b) Move backward in the list
c) We will increase its size
d) We will decrease its size
177. Can we store elements with different data types in a single array?
a) Yes
b) No
c) In some cases
d) None of the given
178. During union by size method, which data structure is used to improve the
balancing of tree?
a) Array
b) Stack
c) Linked List
d) Tree
179. The difference between a "Binary Tree (BT)" and a "Binary Search Tree (BST)"
is Which that,
a) A BST has two children per node whereas a BT can have none, one or two
children per node
b) In BST nodes are inserted based on the values they contain
c) In BT nodes are inserted based on the values they contain
d) There is no difference
180. The main use of AVL tree is:
a) Searching of data
b) Storing of data
c) Insertion of data
d) Security of data
e) The expression
181. if (! heap ->isEmpty() )
checks

a) Heap is empty
b) Heap is full
c) Heap is not empty
d) Not a valid expression
182. A solution is said to be efficient if it solves the problem within its resource
constraints i.e. hardware and time.
a) True
b) False
183. A queue where the dequeue operation does not depend upon FIFO, is called:
a) enqueue
b) simple queue
c) stack
d) priority queue
184. In simple or singly linked list there is/are…………pointer/s in each node.
a) One
b) Two
ÂL-JÛÑÂÎD TÊCH
c) Three
d) Four
185. Which one of the following statement is correct?
a) Array size is fixed once it is created
b) Link List size is fixed once it is created
c) Binary Search Tree size is fixed once it is created
d) AVL Tree size is fixed once it is created
186. Which of the is NOT true regarding the maze generation?
a) Randomly remove walls until the entrance and exit cells are in same set.
b) Removing a wall is the same as doing a union operation
c) Remove a randomly chosen wall if the cells it separates are alreadly in same set
d) Do not remove a randomly chosen wall if the cells it separates are alreadly in same set.
187. If Ahmad is cousin of Ali and Ali is cousin of Asad then Ahmad is also cousin of
Asad. This statement has the following property
a) Reflexivity
b) Symmetry
c) Transitivity
d) All of the given
188. A Linear Data Structure is the data structure in which data elements are arranged
in a sequence or a linear list. Which of the following is Non Linear Data Structure?
a) Arrays
b) Linked Lists
c) Binary Search Trees
d) Stack
189. Recursive call of a function use data structure.
a) Linked List
b) Queue
c) Stack
d) Table
190. ......is the stack characteristic but................was implemented because of the size
limitation of the array.
isFull (), isEmpty ()
pop (), push ()
isEmpty (), isFull ()
push (), pop ()
191. Which of the following operations returns "most recently enterned value" from
the stack?
Push
Recent
Top
First
192. Which of the following operations returns "most recently enterned value" from
the stack?
Reference
Value
Reference & value
Copy of the object can not be passed
ÂL-JÛÑÂÎD TÊCH
193. The variable which are destroyed automatically when a function's execution ends
are:
Global variables
Local variables defined inside function body
Variables (objects) defined inside function body dynamically
Variables (objects) defined inside function body statically
194. The………….of a node in a binary tree is defined as the height of its left subtree
minus height of its right subtree.
a) Height
b) Balance
c) Width
d) None of the above
195. Which operation of queue data structure is used to get front element from the
queue and then remove it from the queue?
a) enqueue()
b) dequeue()
c) front()
d) remove()
196. Suppose we have been given the following data set for a Queue.
7524
What will be the resultant Queue if we call enqueue(3) method?
Note that 7 is the front element whereas 4 is rear element of queue.
a) 7 5 2 4
b) 7 5 2 4
c) 7 5 2 4 3
d) 5 2 4 3
197. In C++, we place the class interface in…………file.
a) .cpp
b) .cppp
c) .h
d) .hh
198. The array in binary search is sub divided………….
a) Once
b) Twice
c) N time
d) Untill a sublist is no more divisible
199. If unions are done by weight (size), the depth of any element is never greater than
a) log 3n
b) log2 n
c) n log2 n
d) log n*n
200. ………………in AVL is logarithmic.
a) Updating
b) Searching
c) Deletion
d) Insertion
201. What is the depth of any tree if the union operation is performed by height?
ÂL-JÛÑÂÎD TÊCH
a) O(N)
b) O(N log N)
c) O(log N)
d) O(M log N)
202. Avl tree takes maximum……………...time to search an element.
a) 1.44 Log2n
b) Log2(n+n)
c) Log2(n+1)+1
d) 1.88 Log2n
203. Which of the following is correct about AVL Tree?

a) It is identical to BST except height of the left and right subtrees can differ by at least 1.
b) It is identical to BST except height of the left and right subtrees must differ by at least 1.
c) It is not identical to BST, it is totally different kind of tree.
d) It is identical to BST except height of the left and right subtrees can differ by at most 1.
204. "new int[11]" will allocate memory for…………..integers.
a) 10
b) 11
c) 12
d) 13
205. The…………. method of list data structure removes the element residing at the
current position
a) Add
b) Next
c) Remove
d) Find
206. While implementing non-recursive traversal for Binary Search Tree, we need to
implement ________ .
a) Queue
b) Stack
c) Min heap
d) Max heap
207. Doubly Linked List always has…………NULL pointer/s in a node.
a) One
b) Two
c) Three
d) Four
208. For a perfect binary tree of height h, having N nodes, the sum of hights of nodes
ia ________.
a) N - h - 1
b) N - 1
c) N - 1 + h
d) N - (h - 1)
209. If there are N elements in an array then the number of maximum steps needed to
find an element using Binary Search is ___________.

a) N
ÂL-JÛÑÂÎD TÊCH
b) N2
c) Nlog2N
d) log2N
210. Here is a small function definition:
void f(int i, int &k)
{
i = 1;
k = 2;
}
Suppose that a main program has two integer variables x and y, which are given the value 0.
Then the main program calls f(x,y); What are the values of x and y after the function f finishes?
a) Both x and y are still 0.
b) x is now 1, but y is still 0.
c) x is still 0, but y is now 2.
d) x is now 1, and y is now 2.
211. The worst case of searching in binary search tree (BST) is:
a) When the data inserted in BST is sorted
b) When the height of left sub-tree is greater than right sub-tree
c) When the height of right sub-tree is greater than left sub-tree
d) When the tree is balanced
212. What is the hash function used in linear probing?
a) hi(x)=hash(x) mod table size
b) hi(x)=(hash(x) + f(i^2)) mod table size
c) hi(x)= (hash(x)+ f(i)) mod table size
d) hi(x)= X mod 17
213. Each operator in a postfix expression refers to the previous ________ operand(s)
a) One
b) Two
c) Three
d) Four

214. In 1990, Bill pugh proposed an enhancement on linked lists and the new data
structure was termed as
a) Linked list
b) B-Tree
c) Skip list
d) Spelling checker
215. Which of the following statement is NOT correct regarding Table ADT?
a) In a table, the type of information in columns may be different.
b) A table consists of deveral columns known as entities
c) The row of a table is called a record
d) A major use of table is in databases where we build and use tables for keeping
information
216. A binary tree of N nodes has……………..
a) Log10 N levels
b) Log2 N levels
c) N / 2 levels
ÂL-JÛÑÂÎD TÊCH
d) N x 2 levels
217. If the height of a perfect binary tree is 4. What will be the total number of nodes
in it?
a) 15
b) 16
c) 31
d) 32
218. Which property of equivalence relation is satisfied if we say:
Ahmad R(is related to) Ahmad
a) Reflexivity
b) Symmetry
c) Transitivity
d) All of the given
219. If Ahmad is boss of Ehsan and Ehsan is boss of Umer then Ahmad is also boss of
Umer. The above-mentioned relation is…………

a) Reflexive
b) Symmetry
c) Transitive
d) None of the given
220. Which of the following statement is false?
a) Arrays are dense lists and static data structure
b) data elements in linked list need not be stored in adjecent space in memory
c) pointers store the next data element of a list
d) linked lists are collection of the nodes that contain information part and next pointer
221. Binary search algorithem cannot be applied to…………..
a) Sorted linked list
b) sorted binary trees
c) sorted linear array
d) None of the given
222. Suppose there is an image segmented into pixels. Each pixel has ________
neighbour(s).
a) 0
b) 4
c) 8
d) 16
223. In singly linked list a node consists of two parts:
a) Object and structure
b) Two pointers
c) Two objects
d) Object and pointer
224. A hash function returns a ………..value.
a) Integer
b) Double
c) Float
d) Char
225. In a tree, we link the nodes in such a way that it………a linear structure.
ÂL-JÛÑÂÎD TÊCH
a) does not remain
b) forms
c) reverses
d) remains
226. The principal benefit of a link list over a conventional array is that the order of the
linked items may be from the order that the data seems are stored in memory.
a) Different
b) Identical
c) Same
d) Equivalent
227. The Computer memory can be thought of as a/an.
a) List
b) Queue
c) Stack
d) Array
228. Before using the Pop method of a stack, the user must call the__method.
a) isFull()
b) push()
c) pop()
d) isEmpty()
229. A stack carries behavior.
a) FIFO
b) FEFO
c) LIFO
d) AVCO
230. ……….Method returns the top element of the stack without removing it.
a) Pop()
b) Front()
c) Push()
d) Top()
231. In Queue data structure element are removed from………
a) Pop
b) Push
c) Rear
d) Front
232. In Queue data structure element are full from_____.
a) Pop
b) Push
c) Rear
d) Front
233. “end()” method of list performs its tasks in
a) Many Steps
b) Three Steps
c) One Steps
d) Two Steps
234. Linked List use to store data.
a) Array
ÂL-JÛÑÂÎD TÊCH
b) Variables
c) Linked Memory
d) 2-D Array
235. Complete the push method code of stack void push (int x) { A{____}=x}
a) Count++
b) Count—
c) ++count
d) –count
236. A template is a Function or Class that is Written adata type.
a) Generic
b) None of These
c) Define
d) Specific
237. Trying to remove an element from an empty Stack is called____
a) Garbage Collection
b) Overflow stack
c) Empty collection
d) Underflow of Stack
238. Stack and Queue can be implemented using………..
a) Binary Tree
b) Singly Linked List
c) AVL Tree
d) Binary Search Tree
239. A software solution is said to be efficient if it solves the problem.
a) With its resource constraints
b) With No Time
c) By Consuming more hardware resources.
d) By Using some extra resources.
240. we cannot remove items randomly from………
a) Stack
b) Queue
c) Stack and Queue
d) List
241. Stack push(15) will push 15 on…………
a) Top of the Stack
b) Anywhere of the Stack
c) Middle of the Stack
d) Bottom of the Stack
242. Which of the following is the correct conservation from infix to postfix
expression A*B+C/(E-F).
a) ABC*+EF-/
b) AB*CFE-/*
c) AB*C+EF/*
d) AB+C*E-F/
243. Convert the Given infix from 12+60-23 of expression in postfix form.
a) 12+60 23-
b) 12 60+ -23
ÂL-JÛÑÂÎD TÊCH
c) -12 60 -23
d) None
244. Y=&x[0];
In the above statement, we get the address of the Locatio of the array x and store it in y.
Here “Y” is;
a) Xvalue
b) Zvalue
c) Ivalue
d) Nvalue
245. Last Node in Circular Linked list Contains.
a) Maximum Two points
b) No Null Pointer
c) Atleast one Null pointer
d) None
246. Consider the linked list having data [6, 72, 35, 65,25] stored in it. While current
pointer is pointing memory location having 72 stored in it. After calling add(4) function
on the following linked list current point will point to memory location having value?
a) 36
b) 4
c) 72
d) 25
247. there is no such Node whose next filed is NULL which one of the given option
support the statement
a) Linked List
b) Circular Link list
c) Array
d) Queue
248. Non-recursive calls are faster than which of the following calls?
Parameterized
Recursive
Function
Non-function
249. The balance of a node is the result of “height of left subtree” ……….”height of
right subtree”.
Plus
Minus
Multiply
Divided by
250. Searching an element in an AVL tree takes maximum…………time (where n is
number of nodes in AVL tree)
Log (n+1)
Log (n+1)-1
1.44 log2n
1.66 log2n
251. A complete binary tree having “N” nodes consists of………..levels.
ÂL-JÛÑÂÎD TÊCH
Log2 (N+1)-1
Log2 (N-1) -1
Log2 (N+1) +1
Log2 (N-1) +1
252. In the post-order traversal of a binary search tree, nodes process as:
Left-subtree, Right-subtree, Root
Right-subtree, Root, Left-subtree
Left-subtree, Root, Right-subtree
Right-subtree, Left-subtree, Root
253. The simplest case in a BST to delete a node is:
When the node, that is to be deleted is root node
When the node, that is to be deleted has both left and right child
When the node, that is to be deleted has only one child
When the node, that is to be deleted is a leaf node
254. If class A define class B as its friend, then:
Class A can access private numbers of class B
Class B can access private numbers of class A
Class A can access only the public members of class B
Class B can access only the public members of class A
255. In the statement int& a=b;
a and b pointing to two different memory location
a and b are two different names of the same memory location
a and b are two different variables names
b holds the address of variable a
256. In simple implementation of stack, is Full() method is used due to…………
Limitation of array
Strength of array
Linked list connectivity
Complexity of linked list
257. Write in postfix from 5*(9-7)
5(9 7-)*
5 9 *7-
597-*
5 (9 7 -)
258. What will be result of following postfix expression?
1 2 3*2-
3
4
5
10
259. An array x of 100 integers is declared as,
int x = [100];
int x [100];
integer array x=100;
ÂL-JÛÑÂÎD TÊCH
integer x [] =100;
260. 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
261. A linear Data Structure is the data structure in which data elements are arranged
in a sequence or a linear list. Which of the following is Non-Linear Data Structure?
Arrays
Linked lists
Binary Search Trees
Stack
262. The new operation in C++ for dynamically allocating memory returns,
Size of the memory it has allocated
Pointer to the memory it has allocated
Both size and pointer to the memory it has allocated
Value of the memory it has allocated
263. In…………., a program uses two pointers in the node, i.e one to point to next
node and the other to point to the previous node.
Linked list
Doubly-linked list
Array
Structure
264. The expression AB+C* is called?
Prefix expression
Postfix expression
Infix expression
Prefix and infix expression
265. Consider the function X as under
int X (int& Value)
{
Return Value;
}
Now a and b are integers in a calling function. Which one of the following is a
valid call to the above function X?
a = X (b);
a = X (&b);
a = X (*b);
a = X (&*b);
266. Each node in Binary Search Tree has,
1 pointer
2 pointers
3 pointers
4 pointers
ÂL-JÛÑÂÎD TÊCH
267. 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)
268. The next field in last node of a singly-linked list is set to……..
NAN
1
NULL
-1
269. Consider the following function:
voidtest_a(int n)
{
cout << n << “”;
if (n>0)
420
024
42
24
270. a*(b + c)-d is an example of...........expression.
infix
prefix
postfix
allfix
271. Below the binary Search Tree (BST). If we delete the value 50 from the root
node, what would be the value in the root of the remaining tree?
50
60
70
80
272. Which of the following calling methods does not change the original vale of the
arguments in the calling function?
Call by passing the value of the arguments
Call by passing reference of the arguments
Call by passing the address of the arguments
Call by passing pointer of the arguments
273. which of the following statement is NOT true for reference variable?
Once a reference is created, it cannot be later made to reference another object.
Reference cannot be NULL
Reference can be uninitialized
It is not possible to refer directly to a reference object after it is defined
274. Which of the following statement is correct?
Array size is fixed once it is created
ÂL-JÛÑÂÎD TÊCH
Link List size is fixed once it is created
Binary Search Tree size is fixed once it is created
AVL Tree size is fixed once it is created
275. the data of the problem is of 2GB and the hard disk of 1GB capacity, to solve
this problem we should
Use better data structures
Increase the hard disk space page 5
Use the better algorithm
Use as much data as we store on the hard disk
276. In call by value methodology, a copy of the object is passed to the called
function
False
True page 202
277. The tree structure is a
Linear data structure
Non-linear data structure page 112
Graphical data structure
Data structure like queue
278. 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.
Whenever the parameter has huge size, the function changes the parameter
within its body
279. Here is the start of a C++ class declaration:
class foo
{
public:
void x(foo f);
void y(const foo f);
void z(foo f) const;
Which of three members function can alter the PRIVATE member variables of
the foo object that activates the function?
Only x can alter the private member variables of the object that activates the
function
Only y can alter the private member variables of the object that activates the
function
Only z can alter the private member variables of the object that activates the
function
Two of the functions can alter the private member variables of the object that
activates the function
ÂL-JÛÑÂÎD TÊCH
280. suppose we have a circular array implementation of the queue claas, 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 push member function place new entry in
the array.
data [1]
data [2]
data [11]
data [12]
281. .........is a binary tree where every node has a value, every node's left subtree
contains only values less than equal to the node's value, and every node's right subtree
contains only values that are greater than or equal?
Strictly Binary Tree
Binary Search Tree
AVL Tree
All of these
282. We access elements in AVL tree in,
Linear was only
Non-linear was only
Both linear and non-linear ways
None of the given options
283. AVL tree is,
Non-linear data structure
Linear data structure
Hybrid data structure (Mixture of linear and non-linear)
None of the given options
284. Each operator in a postfix expression refers to the previous............operand(s).
One
Two page 67
Three
Four

285. Suppose currentNode refers to a node in a linked list (using the Node class with
member variables called data and nextNode). What boolean expression wiil be true when
cursor refers to the tail node of the list?
(currentNode == null)
(currentNode->nextNode == null)
(nextNode, data == null)
(currentNode, data == 0.0)
286. Suppose that the class declaration of SomeClass includes the following function
prototype.
Bool Less Than (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 )
ÂL-JÛÑÂÎD TÊCH
287. 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 new instance of primitive type with new Keyword
None of these
288. The operations for adding an entry to a stack is traditionally called:
add
append
insert
push page 53
289. The operation for removing an entry from a stack is trditionally called:
delete
peek
pop
remove
290. Consider the following sequence of push operations in 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
291. ………..is the maximum number of nodes that you can have on stack-linked list?
Zero
2n (where n is the number of nodes in linked list)
Any number
None of these
292. Which of the following can be used to reserve a string value,
Stack
Queue
Both of these
None of these
293. The following are statement related to queues.
(i) The last item to be added to a queue is the first item to be removed
(ii) A queue is a structure in which both ends are not used
(iii) The last element hasn’t to wait until all elements preceding it on the queue are
removed
(iv) A queue is said to be a last-in-first-out list or LIFO data structure.
Which of the above is/are related to normal queues?
(iii) and (ii) only
(i), (ii) and (iv) only
(ii) and (iv) only
None of these
ÂL-JÛÑÂÎD TÊCH
294. An array is a group of consecutive related memory locations.
True
False
295. In an array we can store data elements of different types.
True
False page 7
296. In an array list the current element is
The first element
The middle element
The last element
The element where the current pointer points to
297. Which of the following calling methods does not change the original value of the
argument in the calling function?
None of the given
Call by passing the value of the argument
Call by passing reference of the argument
Call by passing the address of the argument
298. Which of the following statement is NOT correct?
Array size can be changed after its creation
Link list size can be changed after its creation
Binary Search Tree size can be changed after its creation
AVL Tree size can be changed after its creation
299. A queue is a.........data structure, whereas a stack is a................data structure.
FIFO, LIFO page 161,54
LIFO, FIFO
None of these
Both (a) and (b)
300. Which of the following operators has higher priority than all of others?
Multiplication operator
Minus operator
Plus, operator
Exponentiation operator
301. Four statements about trees are below. Three of them are correct. Which one is
incorrect?
Trees are recursively defined multi-dimensional data structures tree
The order of a tree indicates a maximum number of children allowed at each node
of the
A search tree is a special type of tree where all values (i.e. keys) are ordered
If Tree1’s size is greater than Tree2’s size, then the height of Tree1 must also be
greater than Tree2’s height
302. Which of the following is "TRUE" about arrays,
We can increase the size of arrays after their creation.
We can decrease the size of arrays after their creation.
We can increase but can’t decrease the size of arrays after their creation.
We can neither increase nor decrease the size of arrays after their creation.
303. There is/are case/s for rotation in an AVL tree,
1
ÂL-JÛÑÂÎD TÊCH
3
2
4 page 229
304. Consider the following statements.
(i) A binary tree can contain at least 2L nodes at level L.
(ii) A complete binary tree of depth d is a binary tree that contains 2L nodes at
level L between 0 and d, both inclusive
(iii) The total number of nodes (Tn) in a complete binary tree of depth d is 2 d+1 –
1.
(iv) The height of the complete binary tree can be written as h= log2 (Tn +1)-1
where Tn is total number of nodes.
Which of the following is correct in respect of the above statements regarding the
Binary Trees?
(i) and (iii) only
(i), (ii) and (iii) only
(ii) and (iii) only
(ii), (iii) and (iv) only
305. Consider the following infix expression.
5+6/2
If one converts the above expression into postfix, what would be the resultant
expression?
56/+2
5 6 2/+ page 66
5 6/2+
/62 + 5
306. Addition of new items in stack make the pointer............by 2
Increment, bits
Increment, bytes
Decrement, bits
Decrement, bytes
307. Next item in a linked list is known as
Index
Item
Node
Child
308. In an AVL tree to delete a parent with two childs in a straight-line following
rotation will be required: -
Single
Double
Triple
None
309. To check the depth of an AVL tree following time will be taken: -
1.66 log2n
1.44 log2n page 227
Log2(n+1) -1
1.66 log2n (n+1)
310. After creation of an array: -
ÂL-JÛÑÂÎD TÊCH
Size can be increase but cannot be decreased
Size can be decrease but cannot be increased
Size can be neither increase nor be decreased
Size can be increase and can also be decreased
311. Each node in a BST has Pointers: -
1
2
3
4
312. Highest Operators Precedence is of the following operator: -
Plus
Minus
Multiply
Exponentiation
313. Following is linear data structure: -
Stacks
Queues
Both a & b page 52,87
None of these
314. Each entry which points to a null value in a Singly Linked List is known as: -
Node
First nide
Last node
Head node
315. Non-recursive calls are faster than the Recursive calls: -
True page 323
False
316. The data structure is a
Linear
Non-linear page 112
Circular
None of above
317. What will be the valid postfix notation of A+B*C-D
ABC+*D
ABC*+D-
ABCD+-*
AB+D*C
318. When an operator is used in between two operands this is which type of notation
Prefix
Postfix
Infix page 64
None of these
319. A compound Data Structure is 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
Link lists
ÂL-JÛÑÂÎD TÊCH
Binary Search Trees
All of the given
320. Suppose a pointer has been declared in main but has notv assigned any variable
address then
That pointer points to First byte in main function
That pointer points contains a NULL value
None of these
That pointer points to any memory address
321. Which statement of the following statements is incorrect?
Lists can be implemented by using arrays or linked lists
A list is a sequence of one or more data items
Stack is a special kind of list in which all insertions and deletions take place at
one end
Stacks are easier to implement than lists
322. Consider the following function:
void test_a(int n)
{
cout << n << “”;
if (n>0)
test_a(n-2);
}
What is printed by the call test_a(4)?
420
024
02
24
323. Queue follows,
Last in First out
First in Last out
First in First out page 87
None of these
324. In a data structure that can grow easily dynamically at run time without having to
copy existing elements?
Array
List
Both of these
None of these
325. Which one of the following statements is NOT correct.
In linked list the elements are necessary to be contiguous
In linked list the elements may locate at far positions in the memory
In linked list each element also has the address of the next to it
In an array the elements are contiguous
326. linked lists are collections of data items "lined up in a row" , insertions and
deletions can be made only at the front and the back of a linked list.
Arrays
Link lists
ÂL-JÛÑÂÎD TÊCH
Binary Search Trees
None of these
327. Which one of the following is correct about pointers?
They always point to different memory locations
They always point to a single memory location
The address of two pointer variables is same
None of these
328. Which of the following abstract data types are NOT used by Integer Abstract Data
type group?
short
int
float
long
329. We can add elements in QUEUE from..............
Front
Rear page 91
From both rare and front
None of these
330. The following is a segment of a C program.
int pqr(BinaryNode t)
{if (t == null)
return -1;
else
return 1+max(pqr(t.left), pqr(t.right)) }
Identify, what the above program intends to do?
Compute the height of a binary tree using in-order traversal
Compute the height of a binary tree using pre-order traversal
Compute the depth of a binary tree using pre-order traversal
Compute the depth of a binary tree using post-order traversal
331. Consider the following infix expression:
3 + 5 * 6 – 7 *(8 + 5)
Which of the following is a correct equivalent expression(s) for the above?
3 6 5+ * 7 5 8 + - *
3 6 5 7 5 8 + * + -*
356+*785+-*
356*+785+*-
332. Is this a correct statement? Give answer Yes or No.
A node cannot be deleted , when the node to be deleted has both left and subtrees.
Yes
No
333. Deleting a leaf node in binary search tree involves setting...............pointers of that
node's parent as null.
1
2
3
4
ÂL-JÛÑÂÎD TÊCH

You might also like