Board index » delphi » Binary Search Trees??
j.fen...@public.ndh.com (Joachim Fenkes)
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
|
j.fen...@public.ndh.com (Joachim Fenkes)
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Binary Search Trees??
Hi everybody!
I'm working at a simple LZSS algorithm at the moment, and my problem Many thanks in advance! Joachim Fenkes P.S.: Don't ever forget: 42 is the answer!!! |
Peter Ben
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Binary Search Trees??In article <3vnpsr$...@public.ndh.com>, QuoteJoachim Fenkes <j.fen...@public.ndh.com> wrote: A binary search: (Use on a sorted list of fixed size items.) Each node in the tree has a value, and two pointers to nodes which I To add the number 2, compare it with 6. Searching the tree is simply: The problem with binary trees is that if you are unlucky with the Peter Benie |
Gerard Middlet
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Binary Search Trees??Funny you should ask -- I recently asked about k-d trees (which are k The most useful references I found were: Weiss, Mark Allen, 1995, Data Structures and Algorithm Analysis. Gonnet, G.H., 1984, Handbook of Algorithms and Data Structures. Addison Both these books are good sources of further references. The Weiss book Another question: is there a good place to put Pascal source code in the |
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Binary Search Trees?? |
John Howar
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Binary Search Trees??On 3 Aug 1995, Gerard Middleton wrote: Quote> is there a good place to put Pascal source code in the examples for the PASCAL programming language. SWAG packets are available in 57 different catagories as follows : ANSI ARCHIVES CHARS CMDLINE COLOR SWAG Support Team: Gayle Davis Kerry Sokalsky Jeff Fanjoy (Micky) All support sites support 9600+ baud or above. Available at : Updates ONLY available on COMPUSERVE in the BPASCAL forum, EXEC-PC and CRS Available on the Swag-Area in Pascal-Net (2:285/228), the (PDN) Programmer's FREQable from 1:272/38 <<PRISM BBS (914) 344-0350 or 1:272/100 (914) REPORTED INTERNET FTP SITES : Site Directory IP Number USA : (by state) CANADA : ( by province ) EUROPEAN AND ASIAN SITES : ( by country ) HACOM BBS The Netherlands +31-33-803610/801882 read more » |
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Binary Search Trees?? |
Lars Marius Garsh
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Binary Search Trees??QuoteIn article <3vo31e$...@lyra.csx.cam.ac.uk>, pjb1...@cam.ac.uk (Peter Benie) writes: and the first name is Zzzztra, Zachary, and the rest of the tree is normal, then the search path to any given node will only be 1 longer than if you had a better first node. On average the number of searches is the square root of the number of nodes in the tree. --Lars M. |
David Woof
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Binary Search Trees??I would recommend height-balanced binary trees, sometimes called AVL trees, which use algorithms to check the balance of a tree after each insertion and deletion, and so avoid the kind of binary trees that start to resemble linked lists. On the other hand, the trees remain binary, and so don't demand anything too sophisticated. I've used height-balanced binary trees very successfully for a major statistical The algorithms required are very straightforward for insertion, and can be Incidentally, Wirth's deletion algorithm is easily amended if you want to maintain |
Synatu
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Binary Search Trees??I recently coded an AVL tree (named for the inventors/describers -- Adel'son-Vel'skii and Landis, 1962), also known as a height balanced binary tree. Basically the same procedure as described by Peter Benie, but after adding each node you check to see if the tree is balanced, and if not, you shift pointers accordingly. I used Tenenbaum and Augenstein, Data Structures Using Pascal, as my The resulting balanced tree yields a search time that is always equal to |