aalhour / aalhour/C-Sharp-Algorithms
MaxHeap bad algorithm.
- 主要言語
- C#
- スター
- 6.2k
- フォーク
- 1.4k
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
# steps to reproduce
Write a loop, from 1 to 80000, each time add a random int to the max heap.
In theory it takes very little time(NlogN, N=80000, <1sec ), but the program does take a long time.
I'v also tested the BinaryHeap in https://github.com/SolutionsDesign/Algorithmia, it performs well, so it is probably due to the bad algorithm.
コントリビューションガイド
調査の方向性
The issue points to a performance problem in the MaxHeap implementation when adding many random integers. Start by examining the MaxHeap class, likely in the Heaps directory. Compare its insertion algorithm with the BinaryHeap from the referenced Algorithmia repository to identify inefficiencies. Write a benchmark test adding 80,000 random integers to verify the slowness and confirm the fix improves performance to under a second.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- csharp
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100