home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gatech!usenet.ins.cwru.edu!agate!ucbvax!gwdgv1.dnet.gwdg.de!moeller
- From: moeller@gwdgv1.dnet.gwdg.de ("GWDGV1::MOELLER")
- Newsgroups: comp.os.vms
- Subject: re: LIB$ROUTINES and Balanced Binary Trees
- Message-ID: <9301260059.AA24744@ucbvax.Berkeley.EDU>
- Date: 25 Jan 93 17:48:22 GMT
- Sender: daemon@ucbvax.BERKELEY.EDU
- Distribution: world
- Organization: The Internet
- Lines: 20
-
- Wayne Pearson <WPEARSON@KEAN.UCS.MUN.CA> asks:
- > I noticed that there were three routines to manipulate balanced binary trees
- > in the LIB$ run time libraries. These routines were LIB$INSERT_TREE,
- > LIB$LOOKUP_TREE, and LIB$TRAVERSE_TREE. Is the any reason that theres no
- > corresponding LIB$ routine to delete a node from a balanced binary tree?
-
- For the reasons:
- (a) Textbooks tend to leave the "routine to delete a node" as an
- exercise for the reader :-)
- (b) VMS utilities (for which the LIB$routines were written) can live without.
- (c) The LIB$routines allow for duplicate keys. It isn't obvious how to
- define and solve the deletion problem in that case.
-
- If your keys are unique, I might provide you (upon request)
- with a "compatible" LIB_DELETE_TREE() written in VAX C.
-
- Wolfgang J. Moeller, GWDG, D-3400 Goettingen, F.R.Germany | Disclaimer ...
- PSI%(0262)45050352008::MOELLER Phone: +49 551 201516 | No claim intended!
- Internet: moeller@gwdgv1.dnet.gwdg.de | This space intentionally left blank.
-
-