Created
May 3, 2022 08:00
-
-
Save sausheong/06e9d77c1d7bb8b9d44e263ebe5f76f0 to your computer and use it in GitHub Desktop.
mst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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