File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

List Duplicated

 
Shiaber Shaam
Ranch Hand
Posts: 252
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to remove duplicates from arraylist without using set or api?
 
Campbell Ritchie
Sheriff
Pie
Posts: 47293
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With a lot of hard work. Think about how you would do it, and tell us your ideas.
 
Shiaber Shaam
Ranch Hand
Posts: 252
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 47293
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 600
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 47293
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
People are sometimes given assignments or exercises which tell them to avoid the easy or obvious way to do things
 
Shiaber Shaam
Ranch Hand
Posts: 252
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 47293
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well done

Please tell us briefly how you did it, then others can learn from your experience.
 
Shiaber Shaam
Ranch Hand
Posts: 252
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic