From 78a081e8db8ec06a26fdb9f8479c7352cfccb76a Mon Sep 17 00:00:00 2001 From: Sanchime Date: Sun, 14 Aug 2022 17:23:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BA=A2=E9=BB=91=E6=A0=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DataStructures/Trees/RedBlack.fs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DataStructures/Trees/RedBlack.fs b/DataStructures/Trees/RedBlack.fs index 1b41264..2c7bfd2 100644 --- a/DataStructures/Trees/RedBlack.fs +++ b/DataStructures/Trees/RedBlack.fs @@ -5,7 +5,7 @@ module RedBlack = type Color = Red | Black type RedBlackTree<'T> = - | Node of Color * Left: 'T RedBlackTree * Value: 'T * Right: 'T RedBlackTree + | Node of Color * Left: 'T RedBlackTree * Value: 'T * Right:'T RedBlackTree | Leaf let balance = function @@ -24,5 +24,5 @@ module RedBlack = elif y < x then balance (color, a, y, loop b) else s - loop s + let (Node (_, a, b, c)) = loop s in Node (Black, a, b, c) \ No newline at end of file