tagged [sorting]

What is the complexity of the sorted() function?

What is the complexity of the sorted() function? I have a list of lists and I am sorting them using the following Was wondering what is the runtime complexity of this python function?

18 Feb at 17:28

How do I sort an array of custom classes?

How do I sort an array of custom classes? I have a class with 2 strings and 1 double (amount). class Donator - - - Now I have a Array of Donators filled. How I can sort by Amount?

18 Mar at 20:25

What sorting algorithm does the .NET framework implement

What sorting algorithm does the .NET framework implement Could anyone please advise when implementing something like IComparable in .NET what sorting algorithm does .NET use to actually sort the under...

11 May at 03:2

Sorted collection in Java

Sorted collection in Java I'm a beginner in Java. Please suggest which collection(s) can/should be used for maintaining a sorted list in Java. I have tried `Map` and `Set`, but they weren't what I was...

14 May at 21:15

How to sort a Collection<T>?

How to sort a Collection? I have a generic `Collection` and am trying to work out how I can sort the items contained within it. I've tried a few things but I can't get any of them working.

15 Apr at 02:9

Sort Java Collection

Sort Java Collection I have a Java collection: `CustomObject` has an `id` field now before display list I want to sort this collection by that `id`. Is there any way I could that do that?

15 May at 15:5

How can I sort List<T> based on properties of T?

How can I sort List based on properties of T? My Code looks like this : I tried optionInfoList.Sort() but it is not working.

3 Mar at 05:33

Javascript Array.sort implementation?

Javascript Array.sort implementation? Which algorithm does the JavaScript `Array#sort()` function use? I understand that it can take all manner of arguments and functions to perform different kinds of...

28 Jan at 14:18

How to use std::sort to sort an array in C++

How to use std::sort to sort an array in C++ How to use standard template library `std::sort()` to sort an array declared as `int v[2000]`; Does C++ provide some function that can get the begin and en...

10 Apr at 10:55

How to Sort IEnumerable List?

How to Sort IEnumerable List? I have the following list: The `Car` object has a model and a year. I want to sort this list by model and then year (within model). What is the best way of doing this?

24 Feb at 15:7

sorting a vector of structs

sorting a vector of structs I have a `vector info` where `data` is defined as: I need to sort `info` by the length of the word strings. Is there a quick and simple way to do it?

17 Jan at 23:47

C# list.Orderby descending

C# list.Orderby descending I would like to receive a `List` by `Product.Name` in . Similar to the function below which sorts the list in ascending order, just in reverse, is this possible?

30 Jan at 18:10

How can I sort an XDocument by attribute?

How can I sort an XDocument by attribute? I have some XML I want to sort that by . I load that xml using `XDocument`. How can I view that xml sorted by Name?

4 Feb at 07:33

c# How to sort a sorted list by its value column

c# How to sort a sorted list by its value column i have a generic sorted list "results" with key = some filename and value = boolean. I would like to sort the list by the boolean entry or value column...

9 Aug at 00:54

Get N max numbers from a List<int> using lambda expression

Get N max numbers from a List using lambda expression This is my list: How can I get 4 maximum numbers by lambda: I need these ones: `{28, 22, 12, 7}`

31 Jul at 20:30

How to sort a Pandas DataFrame by index?

How to sort a Pandas DataFrame by index? When there is a DataFrame like the following: How can I sort this dataframe by index with each combination of index and column value intact?

26 Jan at 05:43

How to sort an array of ints using a custom comparator?

How to sort an array of ints using a custom comparator? I need to sort an array of ints using a custom comparator, but Java's library doesn't provide a sort function for ints with comparators (compara...

13 Sep at 09:25

IQueryable order by two or more properties

IQueryable order by two or more properties I am currently ordering a list of custom objects using the IQueryable OrderBy method as follows: Now I am looking to sort by more than one property. Is there...

20 Mar at 13:0

Sort string list with dates in C#

Sort string list with dates in C# I have a `List` with dates. My list is: I want to sort the list to look like this: How can I make this?

31 Dec at 14:37

Sorting a comma separated list of values

Sorting a comma separated list of values What's the easiest way to sort a comma separated list of values in Mac OS X: Input: "a, b, aaa, bc" Output: "a, aaa, b, bc" I'd like to do this from the termin...

10 Aug at 00:19

Sort hash by key, return hash in Ruby

Sort hash by key, return hash in Ruby Would this be the best way to sort a hash and return Hash object (instead of Array):

16 Jun at 19:15

From list of integers, get number closest to a given value

From list of integers, get number closest to a given value Given a list of integers, I want to find which number is the closest to a number I give in input: Is there any quick way to do this?

31 Aug at 09:25

Find unique lines

Find unique lines How can I find the unique lines and remove all duplicates from a file? My input file is I would like the result to be: `sort file | uniq` will not do the job. Will show all values 1 ...

8 Dec at 14:30

How to sort a dataFrame in python pandas by two or more columns?

How to sort a dataFrame in python pandas by two or more columns? Suppose I have a dataframe with columns `a`, `b` and `c`, I want to sort the dataframe by column `b` in ascending order, and by column ...

Java Array Sort descending?

Java Array Sort descending? Is there any EASY way to sort an array in descending order like how they have a sort in ascending order in the [Arrays class](http://docs.oracle.com/javase/7/docs/api/java/...

26 Dec at 04:1