to get O(1) lookup, you can use sparse arrays.
if you don't have numeric keys, you need a function
that will map 1to1 text keys to a number (simplest
such function concatenates ascii values).

--- June Kim <[EMAIL PROTECTED]> wrote:

> Hello.
> 
> I have asked if there is hash facility in J for a
> couple of times. At
> first, I thought J's dict class(j-n/z/w-dict) was
> one. However, it
> isn't. (actually, dictionary = map = hash across
> many modern
> programming languages)
> 
> Since the key/value table is dynamically updated,
> m&i. code
> specialization doesn't work(the dict implementation
> doesn't use that
> code either) and hence the lookup time is O(N),
> instead of O(1), which
> is expected for real hash implementations.
> 
> In this reason, dict class is inhibitively expensive
> for using like a
> dictionary in spite of the name and its name may
> confuse J novices.
> 
> Does any one have real hash implementations in J? If
> not, I might have
> to start to make one.
> 
> June
>
----------------------------------------------------------------------
> For information about J forums see
> http://www.jsoftware.com/forums.htm
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to