Click here to Skip to main content
15,891,184 members
Home / Discussions / C#
   

C#

 
AnswerRe: New to C# Programming Pin
Luc Pattyn24-Aug-07 13:28
sitebuilderLuc Pattyn24-Aug-07 13:28 
AnswerRe: New to C# Programming Pin
George L. Jackson24-Aug-07 14:02
George L. Jackson24-Aug-07 14:02 
Newsyou guys rock Pin
invalidsyntax101024-Aug-07 15:54
invalidsyntax101024-Aug-07 15:54 
AnswerRe: New to C# Programming Pin
Thomas Stockwell25-Aug-07 2:31
professionalThomas Stockwell25-Aug-07 2:31 
GeneralRe: New to C# Programming Pin
George L. Jackson25-Aug-07 3:12
George L. Jackson25-Aug-07 3:12 
Question(nOOb help) comparing ArrayLists of structs.. Pin
Dio2224-Aug-07 9:43
Dio2224-Aug-07 9:43 
AnswerRe: (nOOb help) comparing ArrayLists of structs.. Pin
ghle24-Aug-07 11:08
ghle24-Aug-07 11:08 
AnswerRe: (nOOb help) comparing ArrayLists of structs.. Pin
Luc Pattyn24-Aug-07 13:37
sitebuilderLuc Pattyn24-Aug-07 13:37 
For two ArrayLists A and B it all depends on how you define equality:

1. do you require the same number of elements? if so, check that first.

2. do you require the elements to be present in the same order? if so, just read through
both lists at the same time, and compare A[i] with B[i].

3. if not, first sort both lists according to whatever rule you can come up with that
defines a unique order, then go back to 2.

4. if you would allow for doubles then after sorting, remove (or skip) the doubles.

5. if you don't want to sort, you basically must compare N items of A with N items of B,
which is a quadratic job; you can improve a bit by removing the items you discover
are the same (copy them into two new ArrayLists). This reduces the job by a factor of 2

That's all.

Smile | :)





Luc Pattyn [Forum Guidelines] [My Articles]


this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google


QuestionHow do I incorporate these two routines? Pin
solutionsville24-Aug-07 9:21
solutionsville24-Aug-07 9:21 
AnswerRe: How do I incorporate these two routines? Pin
Hessam Jalali24-Aug-07 9:55
Hessam Jalali24-Aug-07 9:55 
AnswerRe: How do I incorporate these two routines? Pin
solutionsville24-Aug-07 10:16
solutionsville24-Aug-07 10:16 
AnswerRe: How do I incorporate these two routines? Pin
Big Daddy Farang24-Aug-07 12:37
Big Daddy Farang24-Aug-07 12:37 
AnswerRe: How do I incorporate these two routines? [modified] Pin
solutionsville24-Aug-07 17:54
solutionsville24-Aug-07 17:54 
GeneralRe: How do I incorporate these two routines? Pin
Big Daddy Farang27-Aug-07 10:03
Big Daddy Farang27-Aug-07 10:03 
AnswerRe: How do I incorporate these two routines? Pin
solutionsville27-Aug-07 12:32
solutionsville27-Aug-07 12:32 
GeneralRe: How do I incorporate these two routines? Pin
Big Daddy Farang27-Aug-07 12:39
Big Daddy Farang27-Aug-07 12:39 
Questiongetting infragistics Pin
starist24-Aug-07 9:12
starist24-Aug-07 9:12 
AnswerRe: getting infragistics Pin
Alaric_24-Aug-07 9:27
professionalAlaric_24-Aug-07 9:27 
GeneralRe: getting infragistics Pin
Dan Neely24-Aug-07 10:06
Dan Neely24-Aug-07 10:06 
QuestionI need a full stop Pin
humayunlalzad24-Aug-07 8:41
humayunlalzad24-Aug-07 8:41 
AnswerRe: I need a full stop Pin
PIEBALDconsult24-Aug-07 9:04
mvePIEBALDconsult24-Aug-07 9:04 
GeneralRe: I need a full stop Pin
Alaric_24-Aug-07 9:05
professionalAlaric_24-Aug-07 9:05 
AnswerRe: I need a full stop Pin
Alaric_24-Aug-07 9:04
professionalAlaric_24-Aug-07 9:04 
AnswerRe: I need a full stop Pin
PIEBALDconsult24-Aug-07 11:58
mvePIEBALDconsult24-Aug-07 11:58 
GeneralRe: I need a full stop Pin
martin_hughes24-Aug-07 11:49
martin_hughes24-Aug-07 11:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.