in reply to Re: Table shuffling challenge
in thread Table shuffling challenge

(critical analysis of this assumption is welcome) ... using a hash makes random access faster as compared to arrays

Not so. Both hashes and arrays are classed as O(1) for access; but that 1 is much higher for hashes than for arrays:

@array = 1..100;; @hash{ 0 .. 99 } = @array;; cmpthese -1,{ a=>q[my$t=0; $t+=$_ for @array;], b=>q[my$t=0; $t+=$hash{$_} for keys %hash;] };; Rate b a b 35255/s -- -66% a 103177/s 193% --

Sparse matrix are only really useful when the ratio of zeros to non-zeros is greater than say 8:1 and the size is 100s of millions.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.