• Post Reply Bookmark Topic Watch Topic
  • New Topic

Set duplication  RSS feed

 
Kaustubh G Sharma
Ranch Hand
Posts: 1283
Chrome Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How set collection take care of duplicate data?
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From Javadoc:

sets contain no pair of elements e1 and e2 such that e1.equals(e2)


and TreeSet uses Comparable
 
Kaustubh G Sharma
Ranch Hand
Posts: 1283
Chrome Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
like for every entry it checks via equals. if it is don't you think it's an very tedious process..
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kaustubh G Sharma wrote: if it is don't you think it's an very tedious process..

then how do you filter the duplicate? there should be a flag/check/equals to identify the duplicate entry right?
 
Kaustubh G Sharma
Ranch Hand
Posts: 1283
Chrome Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seetharaman Venkatasamy wrote:
Kaustubh G Sharma wrote: if it is don't you think it's an very tedious process..

then how do you filter the duplicate? there should be a flag/check/equals to identify the duplicate entry right?


Hmmm... Even I don't know..May be they're confusing me..
 
Matthew Brown
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kaustubh G Sharma wrote:like for every entry it checks via equals. if it is don't you think it's an very tedious process..

That's the great thing about getting a computer to do it for you. Computers don't get bored!
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Matthew Brown wrote:That's the great thing about getting a computer to do it for you. Computers don't get bored!

 
Kaustubh G Sharma
Ranch Hand
Posts: 1283
Chrome Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Matthew Brown wrote:
Kaustubh G Sharma wrote:like for every entry it checks via equals. if it is don't you think it's an very tedious process..

That's the great thing about getting a computer to do it for you. Computers don't get bored!


So as the interviewer who's not getting bored of asking questions
 
Kaustubh G Sharma
Ranch Hand
Posts: 1283
Chrome Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think my less confidence brought me into trouble...Once's loss is the gain for another
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!