¡@

Home 

c# Programming Glossary: comparer.compare

IEnumerable , IEnumerator vs foreach, when to use what

http://stackoverflow.com/questions/1085638/ienumerable-ienumerator-vs-foreach-when-to-use-what

while iterator.MoveNext T candidate iterator.Current if comparer.Compare candidate currentMax 0 currentMax candidate return currentMax..

What's a good, generic algorithm for collapsing a set of potentially-overlapping ranges?

http://stackoverflow.com/questions/1233292/whats-a-good-generic-algorithm-for-collapsing-a-set-of-potentially-overlapping

0 .Start foreach var item in orderdList.Skip 1 if comparer.Compare item.End max 0 comparer.Compare item.Start max 0 newList.Add.. in orderdList.Skip 1 if comparer.Compare item.End max 0 comparer.Compare item.Start max 0 newList.Add new Range T Start min End max.. new Range T Start min End max min item.Start max comparer.Compare max item.End 0 max item.End newList.Add new Range T Start min..

What's the most elegant way to bubble-sort in C#?

http://stackoverflow.com/questions/1595244/whats-the-most-elegant-way-to-bubble-sort-in-c

for int i 0 i list.Length 1 i T x list i T y list i 1 if comparer.Compare x y 0 list i y list i 1 x stillGoing true share improve..

Doing a range lookup in C# - how to implement

http://stackoverflow.com/questions/8948205/doing-a-range-lookup-in-c-sharp-how-to-implement

1 while min max int mid min max 2 int comparison comparer.Compare ranges mid value if comparison 0 return mid if comparison..