Click here to Skip to main content
15,881,281 members
Home / Discussions / C#
   

C#

 
AnswerRe: Sorted Collection in C# Pin
Richard MacCutchan16-Oct-13 5:26
mveRichard MacCutchan16-Oct-13 5:26 
GeneralRe: Sorted Collection in C# Pin
Matt T Heffron16-Oct-13 8:45
professionalMatt T Heffron16-Oct-13 8:45 
AnswerRe: Sorted Collection in C# Pin
Eddy Vluggen16-Oct-13 11:15
professionalEddy Vluggen16-Oct-13 11:15 
AnswerRe: Sorted Collection in C# Pin
BillWoodruff16-Oct-13 15:45
professionalBillWoodruff16-Oct-13 15:45 
AnswerRe: Sorted Collection in C# Pin
NWPU_Tbeck16-Oct-13 17:04
NWPU_Tbeck16-Oct-13 17:04 
AnswerRe: Sorted Collection in C# Pin
Abhinav S16-Oct-13 18:22
Abhinav S16-Oct-13 18:22 
AnswerRe: Sorted Collection in C# Pin
Dinkar Tiwari16-Oct-13 21:25
Dinkar Tiwari16-Oct-13 21:25 
AnswerRe: Sorted Collection in C# Pin
Gabriel Szabo17-Oct-13 1:22
Gabriel Szabo17-Oct-13 1:22 
You could use the OrderBy<TSource, TKey>(Func<TSource, TKey>) extension method.

The actual sorting is deffered until result gets enumerated, so the call to OrderBy() itself is fast.

It performs a stable sort, which means that the order of already sorted elements is preserved.

it does not sort the original sequence in-place. Instead, the returned IEnumerable<tsource> returns elements of the original sequence in sorted order.

And you can speed things up a bit with parallel LINQ like:
C#
var result = sourceSequence.AsParallel().OrderBy(item => item.Key);

Gabriel Szabo

QuestionCapture image from USB 2.0 PC Camera using physical button in the camera Pin
Member 794843016-Oct-13 2:10
Member 794843016-Oct-13 2:10 
AnswerRe: Capture image from USB 2.0 PC Camera using physical button in the camera Pin
Eddy Vluggen16-Oct-13 11:19
professionalEddy Vluggen16-Oct-13 11:19 
GeneralRe: Capture image from USB 2.0 PC Camera using physical button in the camera Pin
Member 794843016-Oct-13 15:05
Member 794843016-Oct-13 15:05 
GeneralRe: Capture image from USB 2.0 PC Camera using physical button in the camera Pin
Dave Kreskowiak17-Oct-13 1:19
mveDave Kreskowiak17-Oct-13 1:19 
Questionweb site interaction Pin
Member 1032069915-Oct-13 10:35
Member 1032069915-Oct-13 10:35 
AnswerRe: web site interaction Pin
Bernhard Hiller15-Oct-13 21:13
Bernhard Hiller15-Oct-13 21:13 
QuestionIn Console Application design table with background column dynamically Pin
karthikchinnu15-Oct-13 7:20
karthikchinnu15-Oct-13 7:20 
SuggestionRe: In Console Application design table with background column dynamically Pin
Richard MacCutchan15-Oct-13 21:35
mveRichard MacCutchan15-Oct-13 21:35 
QuestionAnyone work with AutoCad files? Pin
SledgeHammer0115-Oct-13 4:47
SledgeHammer0115-Oct-13 4:47 
AnswerRe: Anyone work with AutoCad files? Pin
Eddy Vluggen15-Oct-13 5:02
professionalEddy Vluggen15-Oct-13 5:02 
GeneralRe: Anyone work with AutoCad files? Pin
SledgeHammer0115-Oct-13 5:19
SledgeHammer0115-Oct-13 5:19 
QuestionRe: Anyone work with AutoCad files? Pin
Eddy Vluggen15-Oct-13 7:00
professionalEddy Vluggen15-Oct-13 7:00 
AnswerRe: Anyone work with AutoCad files? Pin
TnTinMn15-Oct-13 18:24
TnTinMn15-Oct-13 18:24 
AnswerRe: Anyone work with AutoCad files? Pin
Kenneth Haugland16-Oct-13 2:36
mvaKenneth Haugland16-Oct-13 2:36 
QuestionRead static values in a .dbml page Pin
vkEE15-Oct-13 4:31
vkEE15-Oct-13 4:31 
AnswerRe: Read static values in a .dbml page Pin
Eddy Vluggen15-Oct-13 4:58
professionalEddy Vluggen15-Oct-13 4:58 
GeneralRe: Read static values in a .dbml page Pin
vkEE15-Oct-13 5:17
vkEE15-Oct-13 5:17 

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.