On Nov 30, 2007 10:15 AM, metaperl.j <[EMAIL PROTECTED]> wrote: > but a few have me worried about whether they can be done with ease in J > (some arent listed in that list): > b-tree, n-ary tree, heap , linked list
I think writing b-tree support in J is pretty easy, and you even get good performance if your nodes are large enough (for example, if nodes can have tens of thousands of members). I have even seen otherwise generic presentations on trees display them in a fashion similar (though not identical) to a J nested box represntation. For example: http://www.brpreiss.com/books/opus5/html/page256.html n-ary trees (where each node has one of two sizes: it's either empty or has degree "n") play against J's strengths, and I think you would be better off if you represented those empty tree nodes implicitly rather than explicitly. Linked lists play against J's strengths for much the same reasons as n-ary trees. They are relatively inefficient fixed sized arrays (they are lists of length two where half of the fixed-width list is not used for data but for linked-list overhead, and algorithms running against them are often expressed as scalar operations on individual nodes rather than as list operations on the list as a whole). For most cases, you are better off using J's lists rather than emulating some other system of lists. -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
