iherak / AVLTree

AVL Tree in C# (student assignment)
0 stars 1 forks source link

Error on deletion #3

Open Konard opened 8 years ago

Konard commented 8 years ago

I found a bug in deletion logic.

Steps to reproduce:

  1. Browse https://github.com/Konard/AVLTree/blob/master/TreeData.txt
  2. Add 2
  3. Add 3
  4. Remove 2 (bug here, makes two instances of 3 in the tree)
  5. Remove 3 (unable to remove 3's from the tree)

The result after both 4-th and 5-th steps:

2016-06-24_22-17-32

iherak commented 7 years ago

Hi @Konard!

This repo is a result of a school project from quite a while ago :) therefore, it is not maintained.

However, any PRs will be merged, or, if you'd like, feel free to fork this and use it in any way that fits you. I will add MIT licence soon.

Konard commented 7 years ago

I assumed the code you use is correct, but this bug finally made me think it is better to search in other place. So this what I actually did.

If found a good solution at: https://github.com/programmatom/TreeLib And integrated this solution here: https://github.com/Konard/LinksPlatform/blob/220ca1201108cf8bc3648e439a1bb253c0968aee/Platform/Platform.Data.Core/Collections/Trees/SizedAndThreadedAVLBalancedTreeMethods.cs