File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes optimize the following code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "optimize the following code" Watch "optimize the following code" New topic

optimize the following code

Sandeep Bhandari
Ranch Hand

Joined: Apr 16, 2004
Posts: 201
Below given code prints the following output:


Can you help to remove those nested redundant while loops?? I guess they are causing bottleneck.

SCJP 96% | SCWCD 90%| SCJP mock exams | My SCJP blog
fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11923

What have you tried? What worked? What didn't?

We're not really going to do it for you...

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
I agree. Here's the link:
subject: optimize the following code
It's not a secret anymore!