News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

beta working character tree

Started by hutch--, April 05, 2005, 02:15:02 PM

Previous topic - Next topic

hutch--

The final debugging nearly drove me NUTZ but it looks like its working OK. For lack of the correct terminology it build a "binary" tree that has the logic of an nested IF block or alternatively the same tree structure as a DOS/Windows directory structure.

It is at the mercy of the word order passed to it and has a good chance of not building a well balanced tree but it is purely iterative and does no memory allocations on the fly for each node so it should be reasonably fast. In its current form it takes a single block of allocated memory which must be large enough to handle all of the data pointed at it. I have a design once the rest of it is fully tested that will reallocate the main memory each time the usage comes up near the limit.

There is probably still some redundant code in the conditional testing to build the tree and a final version could do with a serious gutting and inlining some of the code that I used CALL with to make it easier to work on.

It currently handles duplicates by accident after te last rewrite, seems that it falls out the bottom if the word being written is already in the tree. It returns a -1 if the word is not found in testing.

[attachment deleted by admin]
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php