aspose file tools*
The moose likes Java in General and the fly likes Help in knowing how the code works Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Help in knowing how the code works " Watch "Help in knowing how the code works " New topic
Author

Help in knowing how the code works

krishna kumar.s
Greenhorn

Joined: Oct 01, 2011
Posts: 19
The below code produces the unique numbers if numbers 2 to 100 are powered by 2 to 100 i.e 2 pow 2 2 pow 3..... 100 pow 100 . But i am not understanding how the code eliminates duplicates .
Anayonkar Shivalkar
Bartender

Joined: Dec 08, 2010
Posts: 1509
    
    5

krishna kumar.s wrote:But i am not understanding how the code eliminates duplicates .

Hint: What data structure are you using to store your data(i.e. x pow x)?


Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
krishna kumar.s
Greenhorn

Joined: Oct 01, 2011
Posts: 19
I got it the Hash set only takes unique values
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 8196
    
  23

krishna kumar.s wrote:I got it the Hash set only takes unique values

ANY java.util.Set (←click) only stores unique values. You can give it any value you like.

Winston


Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
krishna kumar.s
Greenhorn

Joined: Oct 01, 2011
Posts: 19
Hi
Anayonkar Shivalkar and Winston Gutkowski thanks a lot for your input .

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help in knowing how the code works