Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

I have a Arraylist object, it has duplecate values also. Now
question is i want delete duplecate data in that objet with
out using Set?

Answer Posted / murli

solution without taking time complexity into account

List arr = new ArrayList();
for(int i=0;i<count;i++){
for(int j=i+1;j<count;j++){
if(arr.get(i)!=null && arr.get(i).equals(arr.get(j))){
arr.set(j, null);
}

}
}

while(arr.contains(null))
arr.remove(null);

Is This Answer Correct ?    2 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does java se mean?

1027


How infinite loop is declared?

1021


What is native code?

1120


What is the difference between char and char *?

1079


What is core java used for?

1122


Write code of any action class?

1015


Explain about OOPS concepts and fundamentals.

1044


Can you start a thread twice in Java?

1117


is there a separate stack for each thread in java? : Java thread

975


What is tree in java?

919


What do you understand by the term wrapper classes?

1004


What is the tradeoff between using an unordered array versus an ordered array?

1239


What is array command?

1182


What do heavy weight components mean in java programming?

950


What is a boolean structure?

1089