CMPT 225 Lecture Notes - Hash Table, Adjacency List, Linear Search

16 views2 pages

Document Summary

Cost of dijkstra"s depends both on size of edge list and size of vertex list. More than one variable contributes to running time. Also very dependent on data structure used to store priority queue e = # edges v = # vertices. Indexed heap (heap with an associated hash table) Build heap by hand, make start vertex root, but everything else has same value (priority) so we don"t care where it goes. For indexed, same thing but also have to build hash table - holds heap"s vertex for each index (can use an array if you know they"ll be nice and simple) c is constant. Initialization o(v) | 2 x o(v), so o(v) Remove vertex o(log v) *v | o(log v + log v * c)*v

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents