MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / BenchmarkBSTree_Insert

Function BenchmarkBSTree_Insert

structure/tree/tree_test.go:495–506  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

493const testNum = 10_000
494
495func BenchmarkBSTree_Insert(b *testing.B) {
496 helper := func() {
497 tree := bt.NewBinarySearch[int]()
498 for i := 1; i <= testNum; i++ {
499 tree.Push(i)
500 }
501 }
502
503 for i := 0; i < b.N; i++ {
504 helper()
505 }
506}
507
508func BenchmarkBSTree_Has(b *testing.B) {
509 helper := func() {

Callers

nothing calls this directly

Calls 1

PushMethod · 0.65

Tested by

no test coverage detected