1 of 29

## What's hot

Comparitive Analysis of Algorithm strategies
Comparitive Analysis of Algorithm strategiesTalha Shaikh

Greedy algorithms -Making change-Knapsack-Prim's-Kruskal's
Greedy algorithms -Making change-Knapsack-Prim's-Kruskal'sJay Patel

unit-4-dynamic programming
unit-4-dynamic programminghodcsencet

Greedy Algorithm
Greedy AlgorithmWaqar Akram

Dynamic programming
Dynamic programmingJay Nagar

Algorithm chapter 9
Algorithm chapter 9chidabdu

5.3 dynamic programming 03
5.3 dynamic programming 03Krish_ver2

Dynamic programming in Algorithm Analysis
Dynamic programming in Algorithm AnalysisRajendran

Daa:Dynamic Programing
Daa:Dynamic Programingrupali_2bonde

Dynamic programming - fundamentals review
Dynamic programming - fundamentals reviewElifTech

Lecture 8 dynamic programming
Lecture 8 dynamic programmingOye Tu

### What's hot(20)

Greedymethod
Greedymethod

Comparitive Analysis of Algorithm strategies
Comparitive Analysis of Algorithm strategies

Greedy algorithms -Making change-Knapsack-Prim's-Kruskal's
Greedy algorithms -Making change-Knapsack-Prim's-Kruskal's

Greedy Algorithms
Greedy Algorithms

unit-4-dynamic programming
unit-4-dynamic programming

Greedy algorithm
Greedy algorithm

36 greedy
36 greedy

Greedy Algorithm
Greedy Algorithm

Dynamic programming
Dynamic programming

Algorithm chapter 9
Algorithm chapter 9

5.3 dynamic programming 03
5.3 dynamic programming 03

Greedy method
Greedy method

Dynamic programming in Algorithm Analysis
Dynamic programming in Algorithm Analysis

Greedy Algorithms with examples' b-18298
Greedy Algorithms with examples' b-18298

Lec30
Lec30

DP
DP

Daa:Dynamic Programing
Daa:Dynamic Programing

Dynamic programming - fundamentals review
Dynamic programming - fundamentals review

Lecture 8 dynamic programming
Lecture 8 dynamic programming

A greedy algorithms
A greedy algorithms

## Similar to test pre

Unit 3- Greedy Method.pptx
Unit 3- Greedy Method.pptxMaryJacob24

Unit 3 greedy method
Unit 3 greedy methodMaryJacob24

Unit 3 - Greedy Method
Unit 3 - Greedy MethodMaryJacob24

final-ppts-daa-unit-iii-greedy-method.pdf
final-ppts-daa-unit-iii-greedy-method.pdfJasmineSayyed3

Algorithm Design and Complexity - Course 9
Algorithm Design and Complexity - Course 9Traian Rebedea

Secure Domination in graphs

module4_dynamic programming_2022.pdf
module4_dynamic programming_2022.pdfShiwani Gupta

Dynamic1
Dynamic1MyAlome

Chapter 5.pptx
Chapter 5.pptxTekle12

ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra Sahil Kumar

Analysis and Design of Algorithms notes
Analysis and Design of Algorithms notesProf. Dr. K. Adisesha

Cs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer keyappasami

3.6 applications in optimization
3.6 applications in optimizationmath265

### Similar to test pre(20)

Unit 3- Greedy Method.pptx
Unit 3- Greedy Method.pptx

Daa chapter11
Daa chapter11

Weighted graphs
Weighted graphs

Chapter 16
Chapter 16

Unit 3 greedy method
Unit 3 greedy method

Unit 3 - Greedy Method
Unit 3 - Greedy Method

Approx
Approx

final-ppts-daa-unit-iii-greedy-method.pdf
final-ppts-daa-unit-iii-greedy-method.pdf

Algorithm Design and Complexity - Course 9
Algorithm Design and Complexity - Course 9

Lecture26
Lecture26

Secure Domination in graphs
Secure Domination in graphs

Chapter 24 aoa
Chapter 24 aoa

module4_dynamic programming_2022.pdf
module4_dynamic programming_2022.pdf

Network Design Assignment Help
Network Design Assignment Help

Dynamic1
Dynamic1

Chapter 5.pptx
Chapter 5.pptx

ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra

Analysis and Design of Algorithms notes
Analysis and Design of Algorithms notes

Cs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer key

3.6 applications in optimization
3.6 applications in optimization

### test pre

• 1.
• 2.
• 3.
• 4.
• 5. Example: i 1 2 3 4 5 6 7 8 9 10 11 s i 1 3 0 5 3 5 6 8 8 2 12 f i 4 5 6 7 8 9 10 11 12 13 14 { a 3 , a 9 , a 11 } consists of mutually compatible activities. But it is not a maximal set. { a 1 , a 4 , a 8 , a 11 } is a largest subset of mutually compatible activities. Another largest subset is { a 2 , a 4 , a 9 , a 11 } .
• 6.
• 7.
• 8.
• 9.
• 10.
• 11.
• 12.
• 13.
• 14.
• 15. Theorem 23.1 Proof: Let T be a MST that includes A . Case: ( u , v ) in T . We’re done. Case: ( u , v ) not in T . We have the following: u y x v edge in A cut shows edges in T Theorem 23.1: Let ( S , V - S ) be any cut that respects A , and let ( u , v ) be a light edge crossing ( S , V - S ). Then, ( u , v) is safe for A . ( x , y ) crosses cut. Let T ´ = { T - {( x , y )}}  {( u , v )} . Because ( u , v ) is light for cut, w ( u , v )  w ( x , y ). Thus, w ( T ´) = w ( T ) - w ( x , y ) + w ( u , v )  w ( T ). Hence, T ´ is also a MST. So, ( u , v ) is safe for A .
• 16. Corollary In general, A will consist of several connected components (CC). Corollary: If ( u , v ) is a light edge connecting one CC in G A = ( V , A ) to another CC in G A , then ( u , v ) is safe for A .
• 17.
• 18.
• 19.
• 20.
• 21. Prim’s Algorithm Q := V[G]; for each u  Q do key[u] :=  od ; key[r] := 0;  [r] := NIL; while Q   do u := Extract - Min(Q); for each v  Adj[u] do if v  Q  w(u, v) < key[v] then  [v] := u; key[v] := w(u, v) fi od od Complexity: Using binary heaps: O(E lg V). Initialization – O(V). Building initial queue – O(V). V Extract-Min’s – O(V lgV). E Decrease-Key’s – O(E lg V). Using Fibonacci heaps: O(E + V lg V). (see book) Note: A = {(v,  [v]) : v  v - {r} - Q}. decrease-key operation
• 22. Example of Prim’s Algorithm b/  c/  a/0 d/  e/  f/  5 11 0 3 1 7 -3 2 Q = a b c d e f 0   Not in tree
• 23. Example of Prim’s Algorithm b/5 c/  a/0 d/11 e/  f/  5 11 0 3 1 7 -3 2 Q = b d c e f 5 11  
• 24. Example of Prim’s Algorithm Q = e c d f 3 7 11  b/5 c/7 a/0 d/11 e/3 f/  5 11 0 3 1 7 -3 2
• 25. Example of Prim’s Algorithm Q = d c f 0 1 2 b/5 c/1 a/0 d/0 e/3 f/2 5 11 0 3 1 7 -3 2
• 26. Example of Prim’s Algorithm Q = c f 1 2 b/5 c/1 a/0 d/11 e/3 f/2 5 11 0 3 1 7 -3 2
• 27. Example of Prim’s Algorithm Q = f -3 b/5 c/1 a/0 d/11 e/3 f/-3 5 11 0 3 1 7 -3 2
• 28. Example of Prim’s Algorithm Q =  b/5 c/1 a/0 d/11 e/3 f/-3 5 11 0 3 1 7 -3 2
• 29. Example of Prim’s Algorithm 0 b/5 c/1 a/0 d/0 e/3 f/-3 5 3 1 -3
Current LanguageEnglish
Español
Portugues
Français
Deutsche