Click here to Skip to main content
15,903,012 members

Comments by Javier Ramírez Domínguez (Top 3 by date)

Javier Ramírez Domínguez 6-Apr-16 12:28pm View    
I know there is better ways to check is a number is prime, as Miller–Rabin, for example, I wanted to know how the language deal with a high memory and calculation work. In this code, the computer have to check if the number is prime reading the memory and save (and resize) it if the number is.
Javier Ramírez Domínguez 6-Apr-16 5:58am View    
The Iterators work in a different way in Java than in C++. The fist time you use it.next() in java, you get the array's first element and it puts the "pointer" in the next element. In C++ you need to do it manually, but in both codes the result is the same.
Maybe the iterators are the responsible of the delay, but I'm not totally sure It could cause this impact.
Javier Ramírez Domínguez 6-Apr-16 5:43am View    
I'm using currentTimeMillis in Java and chrono in C++