Data Structures and Algorithms MCQ - Design Techniques

Common Data for Q. 16 & Q. 17

We are given 9 tasks T1, T2… T9. The execution of each task requires one unit of time. We can execute one task at a time. Ti has a profit Pi and a deadline di profit Pi is earned if the task is completed before the end of the dith unit of time.
 TaskT1T2T3T4T5T6T7T8T9
 Profit152030181810231625
 Deadline725345273
Correct AnswerOption C
Rate difficulty Rate difficulty:
Choose a difficulty.
Share this question
Share:

In order to find minimum size of X capable of storing any kind of binary tree, the worst case size of the tree has to be taken.
In the worst case size of the tree has to be taken. In the worst case only a single node will contain the data at each level of the tree.
For example, for 4 data items, the worst case binary tree will be as follows

Generalizing the concept, for n vertices, the levels of tree that are required will be n.
Memory required at each level (starting from root) will be 20, 21, 22, .... 2n-1
∴ Minimum size = 20 + 21 + 22, .... 2n-1
= 20(2n-1)/(2-1) = 2n-1
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *

Correct AnswerOption D
Rate difficulty Rate difficulty:
Choose a difficulty.

Dijkstra’s single source shortest path in not gives the guarantee to work on negative weight edges graph.
But in this graph it gives the correct shootest path for all vertex.
Shortest path for
B → 1
e → –2
F → O
g → 3
h → –2
d → 6
C → 3
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *

Correct AnswerOption D
Rate difficulty Rate difficulty:
Choose a difficulty.

Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *

Correct AnswerOption C
Rate difficulty Rate difficulty:
Choose a difficulty.

If emax is maximum weight edge in graph, them it is possible that emax contain’s in minimum spanning tree.
Example

cd is maximum weight edge and it must present in minimum spanning tree
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *

Correct AnswerOption B
Rate difficulty Rate difficulty:
Choose a difficulty.
Found this useful?
Follow:

Minimum Spanning tree is

Total sum = 1 + 2 + 2 + 2 + 3 + 4 + 4 + 5 + 8 = 31
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *

Why Practice with Avatto?
High Quality MCQsExam-focused questions with accurate answers
Detailed ExplanationsStep-by-step explanations to enhance learning
Latest Exam PatternBased on updated syllabus and pattern
Performance AnalyticsTrack performance and improve weak areas
100% Free PracticePractice unlimited questions for free
Boost Your PreparationAttempt mock tests, previous year papers and topic-wise quizzes.Explore All Tests →