File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java range operator?

 
Winston Gutkowski
Bartender
Pie
Posts: 9472
50
Eclipse IDE Hibernate Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aleksey Vladimirovich wrote:My God, now I got how wrong I was
...
I thought solving of this problem by Winston's approach would request some fancy and very slow algorithm, but I was so wrong. Results talk for themselves.
Thank you guys for steering me to the right solution and your patience! You rock, guys!

And isn't it much more fun when you work out the solution for yourself? That's why we DON'T just hand out answers here.

And well done.

Winston
 
Campbell Ritchie
Sheriff
Pie
Posts: 47232
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
fred rosenberger wrote: . . . I haven't done the math to figure out the complexity of each algorithm, . . .
Iterating the series of numbers to find their prime factors, multiplied by time to multiply those factors. At worst, quadratic, but for large numbers it may approach nlogn complexity.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic