Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Correct pre-allocation of memory in Prim's MST (#839)
Browse files Browse the repository at this point in the history
  • Loading branch information
SohamTamba authored and sbromberger committed Feb 13, 2018
1 parent 9f6ce46 commit b1debf0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/spanningtrees/prim.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function prim_mst end
marked = zeros(Bool, nv(g))

sizehint!(pq, ne(g))
sizehint!(mst, ne(g))
sizehint!(mst, nv(g) - 1)
visit!(g, 1, marked, pq, distmx)

while !isempty(pq)
Expand Down

0 comments on commit b1debf0

Please sign in to comment.