permaculture playing cards*
The moose likes Beginning Java and the fly likes List Duplicated Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "List Duplicated" Watch "List Duplicated" New topic
Author

List Duplicated

Shiaber Shaam
Ranch Hand

Joined: Jun 16, 2006
Posts: 252
How to remove duplicates from arraylist without using set or api?


$Hi/\bEr
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37891
    
  22
With a lot of hard work. Think about how you would do it, and tell us your ideas.
Shiaber Shaam
Ranch Hand

Joined: Jun 16, 2006
Posts: 252
i dont want to use sets. but using api like remove method is fine. am still trying. will post if i get succeed.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37891
    
  22
Good luck with it. If you get part of it right, post what you have and we'll be happy to look at it.
John de Michele
Rancher

Joined: Mar 09, 2009
Posts: 600
Shiaber,

I'm curious about why you don't want to use a Set. It seems like the easiest way to go about removing duplicates.

John.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37891
    
  22
People are sometimes given assignments or exercises which tell them to avoid the easy or obvious way to do things
Shiaber Shaam
Ranch Hand

Joined: Jun 16, 2006
Posts: 252
i didnt want to use sets as i had to do an additional thing while removing duplicates and that cant be done if i remove duplicates using sets. i found some algorithm from net to remove duplicates and enhanced it in the way i wanted.

thanks,
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37891
    
  22
Well done

Please tell us briefly how you did it, then others can learn from your experience.
Shiaber Shaam
Ranch Hand

Joined: Jun 16, 2006
Posts: 252
I tried in a different method by removing duplicates in the orig. list. It didnt work. I got the below algorithm from net and changed to my need.

>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: List Duplicated
 
Similar Threads
logic:equal tag not evaluting
help please....
message-resources problem
JSP Parse error - no setter method found
struts-blank.war