Top "Sorting" questions

Sorting is the process of applying some order to a collection of items.

How to sort with a lambda?

sort(mMyClassVector.begin(), mMyClassVector.end(), [](const MyClass & a, const MyClass & b) { return a.mProperty > b.mProperty; }); I'd …

c++ sorting lambda char constants
Sorting a Python list by two fields

I have the following list created from a sorted csv list1 = sorted(csv1, key=operator.itemgetter(1)) I would actually like …

python sorting
Collections.sort with multiple fields

I have a list of "Report" objects with three fields (All String type)- ReportKey StudentNumber School I have a …

java sorting collections
How do operator.itemgetter() and sort() work?

I have the following code: # initialize a = [] # create the table (name, age, job) a.append(["Nick", 30, "Doctor"]) a.append(["John", 8, "…

python sorting operator-keyword
Sorting options elements alphabetically using jQuery

I'm trying to understand sorting option elements within a select element alphabetically. Ideally, I'd like to have this as a …

javascript jquery html sorting
How do I sort a list of datetime or date objects?

How do I sort a list of date and/or datetime objects? The accepted answer here isn't working for me: …

python list date sorting datetime
How to sort an array in Bash

I have an array in Bash, for example: array=(a c b f 3 5) I need to sort the array. Not …

arrays bash shell sorting
How to sort in-place using the merge sort algorithm?

I know the question is not too specific. All I want is someone to tell me how to convert a …

arrays algorithm sorting mergesort in-place
C# List<> Sort by x then y

Similar to List<> OrderBy Alphabetical Order, we want to sort by one element, then another. we want to …

c# .net sorting
How to enable DataGridView sorting when user clicks on the column header?

I have a datagridview on my form and I populate it with this: dataGridView1.DataSource = students.Select(s => new { …

c# winforms sorting datagridview