Re: Strange machine-level exception
- Posted by Ricardo Forno <ricardoforno at tutopia.com> Jun 18, 2007
- 529 views
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.