From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA28497; Mon, 13 May 2002 09:23:34 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA28583 for ; Mon, 13 May 2002 09:23:33 +0200 (MET DST) Received: from maile.telia.com (maile.telia.com [194.22.190.16]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g4D7NWr21033 for ; Mon, 13 May 2002 09:23:32 +0200 (MET DST) Received: from gateway (h175n2fls34o849.telia.com [217.208.235.175]) by maile.telia.com (8.11.6/8.11.6) with ESMTP id g4D7NS400317; Mon, 13 May 2002 09:23:32 +0200 (CEST) From: "Mattias Waldau" To: "'Gerd Stolpmann'" , Subject: RE: [Caml-list] Suggestion about balanced trees in stdlib Date: Mon, 13 May 2002 09:23:15 +0200 Message-ID: <000301c1fa4f$0e793770$0200a8c0@gateway> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.3416 Importance: Normal In-Reply-To: <20020510185954.C635@ice.gerd-stolpmann.de> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > - operations on intervals: "iter_interval", "fold_interval", > and "interval" In order to solve the mentioned operations, I usually use Splay-trees, which is part of the CDK. They have the following operations. val floor: 'a t -> key -> key * 'a (* [floor s c] returns the greatest element with [key <= c] *) val ceil: 'a t -> key -> key * 'a (* [ceil s c] returns the smallest element with [key >= c] *) val prev: 'a t -> key -> key * 'a (* [prev s c] returns the greatest element with [key < c] *) val next: 'a t -> key -> key * 'a (* [next s c] returns the smallest element with [key > c] *) ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners