Skip to content

Instantly share code, notes, and snippets.

@sausheong
Created May 3, 2022 08:00
Show Gist options
  • Select an option

  • Save sausheong/06e9d77c1d7bb8b9d44e263ebe5f76f0 to your computer and use it in GitHub Desktop.

Select an option

Save sausheong/06e9d77c1d7bb8b9d44e263ebe5f76f0 to your computer and use it in GitHub Desktop.
mst
package main
import (
"testing"
)
func BenchmarkBoruvka(b *testing.B) {
graph := buildGraph()
b.ResetTimer()
for i := 0; i < b.N; i++ {
boruvka(graph)
}
}
func BenchmarkKruskal(b *testing.B) {
graph := buildGraph()
b.ResetTimer()
for i := 0; i < b.N; i++ {
kruskal(graph)
}
}
func BenchmarkPrim(b *testing.B) {
graph := buildGraph()
b.ResetTimer()
for i := 0; i < b.N; i++ {
prim(graph, "A")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment