HomeAbout Me

Dijkstra & Union Find

By Daniel Nguyen
Published in Algorithm
March 17, 2024
1 min read
Dijkstra & Union Find

Dijkstra

Problem: given a weighted graph of non-negative weight, and a source node s, find shortest path from s to all other nodes.

example
example

  • run time: O(nlogn+mlogn). Because m >> n => ~O(mlogn)

    • n is number of node
    • m is number of edge
  • Space: O(n+m) for adjacent list, O(n) for heap => O(n+m)

Union Find


Tags

#Algorithm

Share

Previous Article
User flow & User journey
Next Article
DFS and BFS

Table Of Contents

1
Dijkstra
2
Union Find

Related Posts

Hash Table
April 26, 2024
1 min
© 2025, All Rights Reserved.
Powered By

Quick Links

About Me

Legal Stuff

Social Media