Hi Emir, Aaron Hsu has done a lot of work with bending trees to an array format in his co-dfns compiler. It is not trivial and he has done it in APL, but you might be able to use some of the same techniques for J. Lots of reading and background information here: https://aplwiki.com/wiki/Aaron_Hsu
I will warn you that until he presented his compiler to them, his phd advisory group had told him not to bother because it was impossible. In J I always think of boxed structures as similar to a tree, but I have not delved into tries and how boxed structures would work for them. Cheers, bob > On Apr 11, 2021, at 22:08, Emir U <[email protected]> wrote: > > I've had something of a frustrating time trying to puzzle through an info. > theory algo I'm trying to write in J. The algorithm is simple (Variable > Length Markov Chain) but requires specialised structures to which J doesn't > seem amenable. I've resultantly spent hours looking for an array analogue to > what I need to do, but I've come to the conclusion there isn't one. What I > need is the "trie" data structure (https://en.wikipedia.org/wiki/Trie). The > algorithm uses it extensively to build a trie which summarises how often > every sub-string in a string occurs in a way that is quickly accessible for > further tree operations. What are my supposed to do in situations such as > these? I'm guessing implement trie in C then bind it to J? > > I've had this same problem a few times now. The abstract data structures in > efficient implementations of algorithms are oftimes not array based and > usually cannot be implemented efficiently by chains of block array > operations. Is it fair to say that in these instances J isn't the right > language to use? > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
