(b *testing.B)
| 506 | } |
| 507 | |
| 508 | func BenchmarkBSTree_Has(b *testing.B) { |
| 509 | helper := func() { |
| 510 | tree := bt.NewBinarySearch[int]() |
| 511 | for i := 1; i <= testNum; i++ { |
| 512 | tree.Push(i) |
| 513 | } |
| 514 | |
| 515 | for i := 1; i <= testNum; i++ { |
| 516 | tree.Has(i) |
| 517 | } |
| 518 | } |
| 519 | |
| 520 | for i := 0; i < b.N; i++ { |
| 521 | helper() |
| 522 | } |
| 523 | } |
| 524 | |
| 525 | func BenchmarkBSTree_Delete(b *testing.B) { |
| 526 | helper := func() { |