Skip to content

Commit

Permalink
Merge pull request #177 from Visionaid-International-Ltd/refactor-rbtree
Browse files Browse the repository at this point in the history
Refactor RBTree
  • Loading branch information
ironfede authored Oct 4, 2024
2 parents 3513a59 + 1ecf0df commit 44d4ffa
Show file tree
Hide file tree
Showing 4 changed files with 120 additions and 215 deletions.
2 changes: 1 addition & 1 deletion sources/OpenMcdf/CFStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ List<IRBNode> subStorages
return;
};

Children.VisitTreeNodes(internalAction);
Children.VisitTree(internalAction);

if (recursive && subStorages.Count > 0)
{
Expand Down
33 changes: 33 additions & 0 deletions sources/OpenMcdf/RBTree/IRBNode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System;

namespace RedBlackTree
{
public enum Color
{
RED = 0,
BLACK = 1
}

/// <summary>
/// Red Black Node interface
/// </summary>
// TODO: Make concrete class in v3
public interface IRBNode : IComparable
{
IRBNode Left { get; set; }

IRBNode Right { get; set; }

Color Color { get; set; }

IRBNode Parent { get; set; }

IRBNode Grandparent();

IRBNode Sibling();

IRBNode Uncle();

void AssignValueTo(IRBNode other);
}
}
Loading

0 comments on commit 44d4ffa

Please sign in to comment.