Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You are given a list of tasks. Let's say the tasks are represented by numbers such as 0 , 1 , 2 , 3 .
You are given a list of tasks. Let's say the tasks are represented by numbers such as etc. Some tasks need to be completed before some another task. Consider the following graph representation for this problem. In this directed unweighted graph the numbers inside the yellow nodescircles represent a task. The directed edge between two nodes represent which one should be completed before the other. The pointed node should be completed later. For example in the following graph, Task should be completed only after Task and Task are completed. You need to find an ordering of these tasks.
Please answer the following questions:
What type of searching will you do in the graph to solve this problem? Depth first search or Breadth first Search? Why would you choose that? Explain briefly in few lines.
What will be your algorithm to solve this problem and what will be the complexities? You do not have to write any code here. Just describe the complexities based on the approach that you have chosen.
Give an example of the ordering of the tasks for the following graph in the order that they need to be completed.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started