sorting Questions
4
Suppose I have a long, unordered, and gradually growing column that I search the even numbers from.
=filter(A1:A,ISEVEN(A1:A)=TRUE)
Now I would like to reverse this result, so that the last even n...
Gumshoe asked 30/7, 2020 at 18:50
3
Solved
In the sorting algorithms like heapsort or quicksort, why do standard publications or research papers prefer the term "non-descending" or "non-ascending" when they can simply use ascending or desce...
3
Solved
Trying to use ES6 arrayObj.sort(a,b) => a.property.localeCompare(b.property) syntax but getting error:
TypeError: a.property.localeCompare is not a function.
I'm thinking localeCompare is not ...
Aunt asked 18/9, 2021 at 13:15
5
Solved
I have a QTreeWidget with a column filled with some numbers, how can I sort them?
If I use setSortingEnabled(true); I can sort correctly only strings, so my column is sorted:
1
10
100
2
20
2...
Atrophy asked 12/12, 2008 at 16:10
7
Solved
I need to order an array of objects, composed by a name and a dependencies list (made out of names).
An example of this array could be:
[
{ name: 'a', requires: ['b', 'c'] },
{ name: 'b', requi...
Swashbuckling asked 17/4, 2018 at 10:5
2
This is the code inside the builder method of the Streambuilder that causes the issue:
List<User> users = snapshot.data;
users.sort((user1, user2) => (user1.distanceInKm ?? 1000).compareT...
2
Solved
Using Loop invariant to prove correctness of merge sort (Initialization , Maintenance , Termination)
How would you go about proving the correctness of merge sort with reasoning over the states of loop invariants?.The only thing that i can visualize is that during the merge step the subarrays(invar...
Pygmy asked 9/11, 2016 at 3:23
8
Solved
I have a set of data which is split into two arrays (let's call them data and keys). That is, for any given item with an index i, I can access the data for that item with data[i] and the key for th...
1
Given a []int, e.g: is := []int{2, 4, 1, 3}
Can sort via:
sort.Sort(), e.g:
sort.Sort(sort.IntSlice(is))
slices.Sort(), e,g:
slices.Sort(is)
I know slices.Sort() is experience, from "gol...
3
I'm trying to implement merge sort but somehow have been stuck for a day.
[Sorry for pasting a big amount of code but wouldn't be able to do without it]
Implementation:
Merge Sort - Function
int me...
13
I need an efficient way to select 2 largest integers from an array of 4, preserving the order.
E.g. 1,4,3,5 -> 4,5; 1,5,3,4 -> 5,4
What's the efficient way to do it (C/C++)?
I.e., with minimu...
1
Since C++11, the C++ Standard Library (c.f. Section 25.4.1.1 of a draft verion of the standard) requires the std::sort algorithm to have asymptotic worst case execution time O(n log n) instead of a...
Slacks asked 17/3, 2021 at 8:47
0
I am working on a high-performance sorting algorithm to sort hundreds of millions of uint64_t data. To improve efficiency, I want to use parallel execution with the x86simdsort library. I can provi...
Shoemaker asked 7/8 at 12:28
11
Is there any method to sort this? Or do I just need to split it and use a loop to compare?
Input
123.4.245.23
104.244.253.29
1.198.3.93
32.183.93.40
104.30.244.2
104.244.4.1
Output
1.198.3.93
3...
Menology asked 7/12, 2012 at 2:51
3
Solved
I have a datatable in Angular 2 app where I want to custom sort a column.
<p-column field="eligible" header="Eligible" sortable="custom" (sortFunction)="sortColumn($event)"></p-column>...
3
I'm learning Javascript and I faced a problem with sorting numbers I don't understand how work sorting function and I find an other way to sort the numbers but it was with list not with arrays I ne...
Checker asked 18/6, 2022 at 17:6
6
Solved
I am trying to re-order my categories from the default alphabetical order.
My admin backend my categories look like this:
And on the frontend they they look like this:
Is it possible to have...
Kalmuck asked 25/4, 2016 at 8:17
7
I use below command to sort the pods by age
kubectl get pods --sort-by={metadata.creationTimestamp}
It shows up pods in descending order. How can we select sorting order like ascending?
Swede asked 31/7, 2019 at 15:54
4
Solved
I have a very large file, over 100GB (many billions of lines), and I would like to conduct a two-level sort as quick as possible on a Unix system with limited memory. This will be one step in a lar...
14
Solved
Given two strings a and b, where a is lexicographically < b, I'd like to return a string c such that a < c < b. The use case is inserting a node in a database sorted by such keys. You can ...
2
Solved
I need to sort uint64 arrays of length 1e8-1e9, which is one of the performance bottlenecks in my current project. I have just recently updated numpy v2.0 version, in which the sorting algorithm is...
Celom asked 21/6 at 17:19
6
Solved
I have a class where optionally a Comparator can be specified.
Since the Comparator is optional, I have to evaluate its presence and execute the same stream code, either with sorted() or without...
Loincloth asked 27/7, 2017 at 6:7
1
Overview
There are a few questions similar to this one but they are all slightly different. To be clear, if values is an array of integers, I want to find perm such that sorted_values (values sort...
28
So I was going through different sorting algorithms. But almost all the sorting algorithms require 2 loops to sort the array. The time complexity of Bubble sort & Insertion sort is O(n) for Bes...
Barrett asked 12/8, 2015 at 14:52
5
Thank you for taking time to read all this, its a lot! Appreciate all you fellow enthusiasts!
How to natural sort?
ie. order a set of alpha numeric data to appear as:
Season 1, Season 2, Season...
Quadruplicate asked 20/3, 2018 at 0:33
1 Next >
© 2022 - 2024 — McMap. All rights reserved.