The huffman code lab might be of interest here. I could also say something about efficiency, but my sense there is that benchmarks often show that what people think is efficient all-too-often is not.
Take care, -- Raul On Mon, Apr 12, 2021 at 1:08 AM 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
