From 014fc51d291188afd405c33a8281fbb5013ad304 Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Mon, 25 Mar 2024 21:09:26 +0100 Subject: Initial extraction Signed-off-by: Raito Bezarius --- src/main.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index d5bb8f9..884b367 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,10 +1,14 @@ -use std::cmp::Ordering; +pub enum Ordering { + Less, + Equal, + Greater, +} trait Ord { fn cmp(&self, other: &Self) -> Ordering; } -struct AVLNode { +struct AVLNode { value: T, left: AVLTree, right: AVLTree, @@ -12,7 +16,7 @@ struct AVLNode { type AVLTree = Option>>; -struct AVLTreeSet { +struct AVLTreeSet { root: AVLTree, } @@ -53,9 +57,3 @@ impl Ord for u32 { } } } - -fn main() { - let mut tree = AVLTreeSet::new(); - tree.insert(3); - tree.insert(2); -} -- cgit v1.2.3