Questions tagged [sorting]
Sorting is the process of applying some order to a collection of items.
sorting
22
questions
0
votes
0
answers
4
views
Getting Error [Microsoft][ODBC SQL Server Driver] String data, right truncation and Dates sorting incorectly
I am accessing a SQL database and pulling data that I will then filter further for a variety of uses. The current version which pulls properly includes a date column showing YYYY-MM-DD and I want it ...
0
votes
0
answers
12
views
How To Sort A searchString on a Razor Index Page
I have a Razor Page Index that the user would like to have the search results sorted a specific way.
Currently, the searchString can search for several different fields. How would I search for each, ...
0
votes
0
answers
17
views
Sublime Text :: Sort Lines By Regex Matches
Title is pretty much self explanatory.
I have made a sorted list (by countries) of all of the places I have been in :
🇦🇱 Albania :: Tirana
🇦🇹 Austria :: Vienna
🇧🇾 Belarus :: Minsk
🇧🇪 ...
0
votes
0
answers
19
views
Sort results of DataView are different in different versions of .Net Framework
The GoodsNo column of the DataView has two pieces of data, HB3-T017 and HB-T015, which are now sorted by GoodsNo, with different results in .Net2.0 and 8.0.
The order under .Net2.0 is HB3-T017, HB-...
-4
votes
1
answer
42
views
Why is swapping using function and swapping using assignment produce in different results?
This is the code for Quick sort in which i used assignment to swap the values.
def partion(arr,low,high):
partion_index=low
pivot=arr[partion_index]
while (low < high):
while low < ...
0
votes
2
answers
74
views
Why did std::sort use this simple strict weak ordering compare still crash? [duplicate]
Here is my code:
#include<vector>
#include<algorithm>
#include<iostream>
using namespace std;
void test()
{
vector<vector<int>> info = {{0,0,999}, {0,1,1000}, {0,2,...
-1
votes
0
answers
22
views
What should I focus while learning DSA? [closed]
So basically I am learning DSA for the first time and I dont want to overlearn or learn things that aren't neccessary. Can anyone tell me what I should focus on?
DSA learning I am learning quick union ...
1
vote
1
answer
19
views
MultiLabelBinarizer: inverse_transform How can get a list of labels sorted according to their probability?
I am doing a multi label classification and I use MultiLabelBinarizer to translate the list of labels into Zeros and Ones.
I could get the Labels using inverse_transform which is super. However, in a ...
0
votes
0
answers
31
views
How do I make await function last less than one millisecond?
I am currently making a sorting algorithm visualizer using HTML, CSS, and JS. I have most of it down, but I want to give it the ability to sort faster than one comparison a millisecond.
Here is my ...
0
votes
1
answer
64
views
How to store row-position in a database?
I am looking to emulate a feature in Excel/Google Sheets where there is a table of data, but someone may move a row up or down. Here is an example of the interaction:
My first thought as to how to ...
-8
votes
0
answers
71
views
Why does caching/memoization in a sorting comparator increase runtime instead of reducing it? [closed]
I'm solving a problem on Leetcode where I need to sort an array of integers based on their mapped values using a custom digit mapping. I’ve implemented two versions of the solution to address this ...
0
votes
0
answers
66
views
Sorting a DataFrame by Multiple Conditions in Pandas
I'm struggling with a specific sort that I'm not managing to implement in Python.
Here's a sample dataframe
import pandas as pd
data = {
'product': ['A', 'A', 'A', 'B', 'B', 'B'],
'quantity': ...
-1
votes
1
answer
72
views
Shuffle the Array - LeetCode problem. 2 pointers approach fails [closed]
I am trying to solve LeetCode problem 1470. Shuffle the Array:
Given the array nums consisting of 2n elements in the form [x1,x2,...,xn,y1,y2,...,yn].
Return the array in the form [x1,y1,x2,y2,...,xn,...
0
votes
1
answer
53
views
Understanding Time complexity of nested sorting
I am solving this LeetCode problem 1636. Sort Array by Increasing Frequency:
Given an array of integers nums, sort the array in increasing order based on the frequency of the values. If multiple ...
-3
votes
1
answer
116
views
Confused about the sort() function in C++ [duplicate]
I've just done a problem on Leetcode. But I was confused about the sort() function of C++.
This is more detail about it:
Given an array of integers nums, sort the array in increasing order based on ...