Example pop the front of the queue c h d i a j b f g

Info icon This preview shows pages 93–114. Sign up to view the full content.

View Full Document Right Arrow Icon
Example Pop the front of the queue C H D I A J B F G K Queue: A 0 B 0 C 0 D 0 E 1 F 0 G 0 H 0 I 0 J 0 K 0 L 2
Image of page 93

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Example Pop the front of the queue G has two neighbors: E and L C H D I A J B F G K Queue: A 0 B 0 C 0 D 0 E 1 F 0 G 0 H 0 I 0 J 0 K 0 L 2
Image of page 94
Example Pop the front of the queue G has two neighbors: E and L Decrement their in-degrees C H D I A J B F G K Queue: A 0 B 0 C 0 D 0 E 0 F 0 G 0 H 0 I 0 J 0 K 0 L 1
Image of page 95

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Example Pop the front of the queue G has two neighbors: E and L Decrement their in-degrees E is decremented to zero, so push it onto the queue C H D I A J B F G K E Queue: A 0 B 0 C 0 D 0 E 0 F 0 G 0 H 0 I 0 J 0 K 0 L 1
Image of page 96
Example Pop the front of the queue C H D I A J B F G K E Queue: A 0 B 0 C 0 D 0 E 0 F 0 G 0 H 0 I 0 J 0 K 0 L 1
Image of page 97

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Example Pop the front of the queue K has one neighbors: L C H D I A J B F G K E Queue: A 0 B 0 C 0 D 0 E 0 F 0 G 0 H 0 I 0 J 0 K 0 L 1
Image of page 98
Example Pop the front of the queue K has one neighbors: L Decrement its in-degree C H D I A J B F G K E Queue: A 0 B 0 C 0 D 0 E 0 F 0 G 0 H 0 I 0 J 0 K 0 L 0
Image of page 99

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Example Pop the front of the queue K has one neighbors: L Decrement its in-degree L is decremented to zero, so push it onto the queue C H D I A J B F G K E L Queue: A 0 B 0 C 0 D 0 E 0 F 0 G 0 H 0 I 0 J 0 K 0 L 0
Image of page 100
Example Pop the front of the queue C H D I A J B F G K E L Queue: A 0 B 0 C 0 D 0 E 0 F 0 G 0 H 0 I 0 J 0 K 0 L 0
Image of page 101

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Example Pop the front of the queue E has no neighbors—it is a sink C H D I A J B F G K E L Queue: A 0 B 0 C 0 D 0 E 0 F 0 G 0 H 0 I 0 J 0 K 0 L 0
Image of page 102
Example Pop the front of the queue C H D I A J B F G K E L Queue: A 0 B 0 C 0 D 0 E 0 F 0 G 0 H 0 I 0 J 0 K 0 L 0
Image of page 103

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Example Pop the front of the queue L has no neighbors—it is also a sink C H D I A J B F G K E L Queue: A 0 B 0 C 0 D 0 E 0 F 0 G 0 H 0 I 0 J 0 K 0 L 0
Image of page 104
Example The queue is empty, so we are done C H D I A J B F G K E L Queue: A 0 B 0 C 0 D 0 E 0 F 0 G 0 H 0 I 0 J 0 K 0 L 0
Image of page 105

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Example The array used for the queue stores the topological sort C H D I A J B F G K E L A 0 B 0 C 0 D 0 E 0 F 0 G 0 H 0 I 0 J 0 K 0 L 0
Image of page 106
Example The array used for the queue stores the topological sort Note the difference in order from our previous sort? C, H, D, A , B , I , J , F , G , E , K , L C H D I A J B F G K E L A 0 B 0 C 0 D 0 E 0 F 0 G 0 H 0 I 0 J 0 K 0 L 0
Image of page 107

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Outline Topological sorting Definitions Algorithm Finding the critical path
Image of page 108
Critical path Suppose each task has a performance time associated with it If the tasks are performed serially, the time required to complete the last task equals to the sum of the individual task times These tasks require 0.3 + 0.7 + 0.5 + 0.4 + 0.1 = 2.0 s to execute serially
Image of page 109

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Critical path In many cases, however, we could perform tasks in parallel Computer tasks can be executed in parallel (multi-processing) Different tasks can be completed by different teams in a company
Image of page 110
Critical path Suppose Task A completes We can now execute Tasks B and D in parallel
Image of page 111

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Critical path Note that, Task E cannot execute until Task C completes, and Task C cannot execute until Task B completes The least time in which these five tasks can be completed is 0.3 + 0.5 + 0.4 + 0.1 = 1.3 s This is called the critical time of all tasks The path (A, B, C, E) is said to be the critical path
Image of page 112
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern