help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hash Function


From: Jordi Gutiérrez Hermoso
Subject: Re: Hash Function
Date: Wed, 5 Dec 2012 12:31:48 -0500

On 5 December 2012 11:51, Sergei Steshenko <address@hidden> wrote:
>
>
>
>
> ----- Original Message -----
>> From: Jordi Gutiérrez Hermoso <address@hidden>
>> To: Sergei Steshenko <address@hidden>
>> Cc: Jonathan Karsch <address@hidden>; "address@hidden" <address@hidden>
>> Sent: Wednesday, December 5, 2012 6:13 PM
>> Subject: Re: Hash Function
>>
>> On 5 December 2012 11:04, Sergei Steshenko <address@hidden> wrote:
>>
>>>  Jordi,
>>
>> Hello, Sergei. Nice to talk to you again.
>>
>>>  why are you posting distracting info ?
>>
>> I'm sorry to inform you that you are. As I have explained numerous
>> times, there is no hashing in Octave, despite your deceptive variable
>> names. I know you are well aware of this, but for the edification of
>> those who are not as blessed in computer science as you are, here is a
>> description of the actual data structure available in Octave:
>>
>>     http://en.wikipedia.org/wiki/Red-black_tree
>>
>>>  It _is_ possible to do this in Octave
>>
>> As you well know, this is only possible due to a bug in Octave that
>> you have exploited, and you should be happy to know that this bug has
>> been elevated to the status of feature in the current development
>> version.
>>
>> - Jordi G. H.
>>
>
> http://en.wikipedia.org/wiki/Red-black_tree :
>
> "... typically used to implement associative arrays."
>
>
>
> https://en.wikipedia.org/wiki/Duck_test :
>
> "If it looks like a duck, swims like a duck, and quacks like a duck, then it 
> probably is a duck".

But it doesn't quack like a duck. Hashes are just one way to implement
associative arrays; red-black trees are another. Lookups are O(log(n))
for red-black trees, not O(1). This can provoke a slow down for large
data sets that in most cases you do not want. The trade-off for that
slowdown is that you can have ordered sets, which you cannot have with
hashes.

I know you already know these things, just kindly reminding other
readers of kindergarten computer science.

- Jordi G. H.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]