binary-trees
Here are 303 public repositories matching this topic...
-
Updated
May 22, 2022 - JavaScript
-
Updated
Aug 26, 2017 - TypeScript
-
Updated
Jun 28, 2022 - Python
-
Updated
Jul 4, 2022 - C#
-
Updated
Feb 12, 2019 - Go
-
Updated
Feb 7, 2022 - C++
-
Updated
Jan 7, 2017 - JavaScript
-
Updated
Mar 30, 2022 - Java
I'm 100% sure I accidentally implemented this wrong for two children nodes — should fix. Algorithm should be something like:
find node to delete
if has two children
_node := max in left subtree || min in right subtree
swap values
delete _node
-
Updated
Jul 7, 2022 - C#
-
Updated
May 21, 2019 - C++
-
Updated
May 2, 2017
-
Updated
Dec 7, 2019 - Julia
-
Updated
Feb 21, 2018 - Python
-
Updated
Oct 15, 2021 - C++
-
Updated
Mar 12, 2017 - Swift
-
Updated
Apr 14, 2018
-
Updated
Jun 3, 2022 - C
-
Updated
Jun 20, 2021 - Python
Largest BST
-
Updated
Apr 28, 2022 - Swift
-
Updated
Sep 5, 2021 - SystemVerilog
-
Updated
May 14, 2021
-
Updated
Jun 21, 2021 - Python
Source of really hard to track down bugs.
Currently, all three tree implementations manage their own memory. Being containers, they copy in whatever object is passed to them. If this has, say, a string, with a pointer to the GC heap it may be reaped when its original reference goes out of scope, even though the tree holds on to it. Potential disaster. Of course this can be avoided by passing on
-
Updated
Jan 6, 2018 - C
-
Updated
Sep 8, 2019 - C++
-
Updated
Dec 18, 2018 - C++
-
Updated
Dec 3, 2021 - Python
Improve this page
Add a description, image, and links to the binary-trees topic page so that developers can more easily learn about it.
Add this topic to your repo
To associate your repository with the binary-trees topic, visit your repo's landing page and select "manage topics."
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.