Re: Strange machine-level exception

new topic     » goto parent     » topic index » view thread      » older message » newer message

Hi Juergen.
I did not try your program, but apart from this, I have a suggestion to 
improve its speed.
 From the point of view of computational complexity, your code is
O(n*n).
This can be improved by first sorting the sequence, which is O(log(n)*n),
and then examining it linearly eliminating the equal elements, which is
O(n), giving a joint complexity O(log(n)*n).
This improvement will be more noticeable as the sequence length increases.

Regards.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu