Runtimes of Graphs

0.0(0)
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/8

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

9 Terms

1
New cards

what is the runtime general formula for dijkstras/prims? What do you do to each phrase/word?

VExtractions + EUpdates + Read Graph

extractions and updates are considered whether itā€™s a heap or array

read graph is based on adj. list (sparse or dense) or matrix

2
New cards

what happens to updates and extractions when we are dealing with a heap?

logV for both

3
New cards

what happens to extractions and updates when its an array ?

extractions = V so V*V

updates = o(1) so EO(1)

4
New cards

what happens to adj list when sparse? dense?

V + E for sparse

VĀ² for Dense

5
New cards

what is the runtime of both BFS AND DFS?

V+E for List

vĀ² for Matrix

6
New cards

Runtime for bellman?

o(VE) for list

O(VĀ³) for matrix

7
New cards

what is kruskals general formula?

ElogE (sorting) + E(Find) + V(Unions)

usually both logV for find and union

= ElogE

8
New cards

what is the runtime for PRIMS/D when irā€™s an array/adj.list or matrix ? = o(vĀ²)

9
New cards

runtime for prims or dijkstras when itā€™s heap and list/matrix

ELogV for list

ELogE + VĀ² for matrix