This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Inspired by: http://jng.imagine27.com/articles/2011-06-28-141124_purely_functional_types_red_black_trees_in_qi.html | |
type TreeNode<'a> = { Key: int; Val: 'a } | |
type Color = Red | Black | |
type Tree<'a> = { Color: Color; LTree: Tree<'a> option; TreeNode: TreeNode<'a>; RTree: Tree<'a> option; } | |
let makeTreeBlack tree = | |
match tree with |
NewerOlder