本文整理汇总了C#中RedBlackTree.InorderTreeWalk方法的典型用法代码示例。如果您正苦于以下问题:C# RedBlackTree.InorderTreeWalk方法的具体用法?C# RedBlackTree.InorderTreeWalk怎么用?C# RedBlackTree.InorderTreeWalk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RedBlackTree
的用法示例。
在下文中一共展示了RedBlackTree.InorderTreeWalk方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildStorageEntry
private static int BuildStorageEntry(DirectoryEntry storageEntry)
{
// direct members of each storage are organised in a separate red-black tree
RedBlackTree<DirectoryEntry> rbTree = new RedBlackTree<DirectoryEntry>();
foreach (DirectoryEntry entry in storageEntry.Members.Values)
{
rbTree.Add(entry);
}
foreach (RedBlackTreeNode<DirectoryEntry> node in rbTree.InorderTreeWalk(rbTree.Root))
{
DirectoryEntry entry = node.Data;
entry.NodeColor = GetNodeColor(node.Color);
entry.LeftChildDID = GetNodeID(node.Left);
entry.RightChildDID = GetNodeID(node.Right);
if (entry.Members.Count > 0)
{
entry.EntryType = EntryType.Storage;
entry.MembersTreeNodeDID = BuildStorageEntry(entry);
}
else
{
entry.EntryType = EntryType.Stream;
entry.MembersTreeNodeDID = -1;
}
}
return rbTree.Root.Data.ID;
}