77,937 questions
0
votes
1
answer
25
views
Why is the worst-case binary selection sort time complexity considered O(n^2)?
Wikipedia and other textbooks reference binary selection sort's asymptotic worst-case time complexity to be O(n^2), usually justifying this with any extra computation caused by swaps. I don't ...
0
votes
0
answers
31
views
Sorting completed date in WooCommerce order list (admin dashboard)
I added a new column of completed date in the woocommerce order list page using the code here. The new column shows sorting buttons (up/down arrows) properly but when clicked, seems like it sorts on ...
-3
votes
2
answers
30
views
HTTP 400 error when attempting to sort column [closed]
phpMyAdmin 5.2.2 and 5.2.3 (possibly prior versions also) throw a 400 error when attempting to sort on a column in a table. I traced the problem to the inclusion of a line-feed in the sql_query ...
0
votes
0
answers
35
views
Sorting items in a Pina store is very slow
I have a Pinia store defined like this:
export type Era = {
id: number
name: string
start_year: number
end_year: number
item_count: number
}
const settingStore = {
eras: ref([] as Era[])...
1
vote
1
answer
120
views
I need to sort a list of coordinate pairs by y decreasing then x increasing [duplicate]
I am trying to sort this list of pairs so they are ordered by y decreasing as the primary factor and x increasing as a tie breaker.
[['0', '0'], ['0', '1'], ['1','1'], ['2','1'], ['0', '2'], ['1','2'],...
0
votes
1
answer
51
views
Sort Tabs Alphabetically keeping Certain Tabs first and ignoring Hidden Tabs
I have a file that includes a variety of reference sheets and sheets that are only used at the end of the academic year plus a tab/sheet for individual students. Students come and go so I need the ...
1
vote
2
answers
119
views
How to sort only based on the value in the B column of every row?
This is what I am currently using for my code.
Private Sub CommandButton1_Click()
' Sort button and save a backup copy
Range("B1").Sort Key1:=Range("b3"), Order1:=xlAscending, Key2:...
-2
votes
1
answer
110
views
Is this a valid JavaScript approach for sorting large arrays of unique integers efficiently? [closed]
I’m experimenting with sorting large arrays of unique integers in JavaScript and came up with a simple approach. I’m curious if it’s a recognized pattern or if there are potential pitfalls I might be ...
0
votes
2
answers
90
views
Make onEdit work for two separate tables within the same sheet [closed]
How would I be able to make this function work for two separate tables within the same sheet?
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("Leaderboard"); ...
2
votes
1
answer
79
views
Sort each row of a pandas column consisting of delimited strings
CONTEXT
Let's say I have df, which consists of a column of delimited strings that I would like to sort.
import pandas as pd
df = pd.DataFrame({'sort_me':['foo; bar','foo; bar','bar; foo']})
df
...
1
vote
2
answers
130
views
Room Database - Secondary ORDER BY not working Java
I have a RecyclerView list of CardViews for tasks, etc. Some of the CardViews have a due date attached to them, others have no due date. I want to show the CardViews with due dates on top of the ...
-2
votes
1
answer
114
views
Complex SQL query not sorting correctly
I have a complex SQL query that is not sorting the results properly. It is supposed to sort the list of questions in order of the ORDERS column of the Questions table, but instead, it is always ...
3
votes
0
answers
149
views
Encountering problems while making a sorting algorithm in python 3
I am an inexperienced coder, and took up the challenge to make a sorting algorithm to sort lists. I see people using the mod operator, and didn't like it, so I am using strings to make it a little ...
1
vote
2
answers
90
views
Sorting a list of objects. Is it possible to use a property as parameter?
This is a simple class (Person) with a shared list (Persons). My question concerns the possibility of improving the code in the method SortByPropertyName. It works as it is but, it would more handy if ...
-3
votes
1
answer
113
views
Array passed as an argument does not seem to be changing [closed]
I was tasked to write up a C program to sort an array using quicksort, without using recursion.
Original array:
-25, 87, 12, -6, 91, 3, -48, 70, 19, -33, 55, 2, -18, 99, 41, -72, 63, 15, -90, 27, 8, -...