Questions tagged [sorting]

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

0
votes
0answers
3 views

Time complexity of sorting algorithms with satellite data

I am currently going through CRLS and I am confused about the time complexity of sorting operations with satellite data.Let's say I have four data points like this:{key: 3, satellite_data: ...
0
votes
1answer
8 views

Java TableRowSorter not sorting table rows correctly

I am using a TableRowSorter to sort a DefaultTableModel in my JTable. I have used the codeTableRowSorter<DefaultTableModel> sorter=new TableRowSorter<DefaultTableModel>(itemTableModel);...
0
votes
0answers
25 views

Excel / XLS - filter data (with regex) and transform it to new cells. (Possible with openrefine?)

I'm stuck with a problem. I'm not an excel expert.I found some Threads how to use regex in excel, like:How to use Regular Expressions (Regex) in Microsoft Excel both in-cell and loopsBut I don't ...
5
votes
3answers
76 views

Python: Generate all uniquely ordered lists of length N

I want to exhaustively analyse subroutines for sorting small arrays and need a way to generate all uniquely ordered arrays of a particular length.In Python, that would be lists with non-negative ...
0
votes
1answer
13 views

Insertion sort implemented on a csv file's lines in python

I'm looking to change my current insertion sort algorithm to sort files and I have no idea where to start. This is my code so far:def insertionSort(arr):for i in range(1,len(arr)):key ...
0
votes
1answer
18 views

Primeng <p-dataTable> : sorting data which contains '-'

I am using primeNg <p-dataTable> to implement custom sort for "Row No:" field.The values in the row number field will be as below:9864-34738-10935-42788-2Source : https://primefaces.org/...
2
votes
1answer
44 views

Sorting an array— issue

I'm asking for help with a problem implying an array sorting in the following manner: all even numbers must be in front of the odd ones. I've partially made the problem, but I did the sorting in the ...
-6
votes
0answers
44 views

Is there any way to debug internal steps in sorting? [on hold]

I sorted a list based on my own compare function and in the sorted list, one of the element was replaced by another. So the sorted list does not contain the replaced element and contains two identical ...
-8
votes
0answers
26 views

Python read XML file and sort by cast [on hold]

I have an XML file with movie details in it and i need to sort these by cast. I also want that the user can see which movie is is broadcasted by the company he works for and what the competitors are ...
2
votes
1answer
33 views

Sort alphaNumeric HTML list

I need to sort an alphaNumeric list. I am able to sort but some how because it is alphaNumeric, I am not able to put the abc1 before the abc10.My HTML Code:<ul class="theList"><li>&...
0
votes
0answers
20 views

Excel: How to efficiently sort many rows, left to right, independently of each other?

There's a good example of exactly what I'm looking to do here:https://www.extendoffice.com/documents/excel/3870-excel-sort-each-row-individually-alphabetically.html.However, in the instructions, ...
0
votes
1answer
29 views

VBA sorting creating a Range from Large Formula

I am looking to sort a column alphabetically (E) but I need to change the values in my columns in order for the alphabetical order to be correct ex: I have R1, R2, R3...R100, CN1, CN10, etc......
1
vote
1answer
34 views

MATLAB: Identify maxima and minima and split data accordingly

I have the following arrays:x=[1:33]; y=[0 1 2 3 4 5 4 3 2 1 0 1 2 3 4 5 4 3 2 1 0 1 2 1 0 1 2 3 4 3 2 1 0];I need to separate y into different sections. I need to obtain the ascending parts, ...
1
vote
2answers
74 views

Finding Median in Large Integer File of Integers

I was asked in an interview the following. I didn't get it but trying to solve it at home. I believe we have to use the Median of Median algorithm...Q: Finding Median in Large Integer File of ...
0
votes
0answers
27 views

How to do sorting on the basis of column name in php? [on hold]

I am working on a website in which I want to do sorting on the basis of names. The website contains table row of elements in which I want to do sorting on the basis of Names (by 1st column). The ...
0
votes
0answers
50 views

Find the Rotation Count in Rotated Sorted array

I got the following question:Consider an array of distinct numbers sorted in increasing order. The array has been rotated (clockwise) k number of times. Given such an array, find the value of k.I ...
0
votes
2answers
51 views

How can I sort 128 bit unsigned integers in Python?

I have a huge number of 128-bit unsigned integers that need to be sorted for analysis (around a trillion of them!).The research I have done on 128-bit integers has led me down a bit of a blind alley,...
1
vote
3answers
38 views

Sorting a list of dictionaries that contains a list as a value

I have this list of dictionaries which have a list as the value:>>> lod[{'A': ['100', '200', '300', 600]}, {'B': ['1000', '2000', '3000', 6000]}, {'C': ['1', '2', '3', 6]}]and basically, ...
0
votes
1answer
30 views

How to sort a CSV file in PHP without loading the entire file into memory?

I'm trying to write a PHP script which will handle sorting of a CSV file by one or multiple columns and outputting the result to another file.Is there a way to sort the CSV file without loading it ...
0
votes
1answer
36 views

How to organise alphabetically an array of objects in Java

I am trying to simulate a library of Albums. But I would also be able to organise the contents of the library alphabetically by the author's name. Any help in how to organise the contents of the array ...
0
votes
0answers
36 views

Maximum utilization of a vehicle. Finding max value from 2 arrays

I am trying to solve a simple optimization problem and have proposed solution. Just wondering if it is correct or not. Here is the problem descriptionThere is a vehicle that can travel a total ...
3
votes
0answers
76 views

Recursive MergeSort is faster than iterative MergeSort

I just implemented the two algorithms and I was surprised when I plotted the results! Recursive implementation is clearly faster than the iterative one.After that, I added the insertion sort combined ...
0
votes
1answer
36 views

Generate pairs of students from list of names, new pairs each week

I have a list of students names, and I want to pair each student with another student every week. Obviously, students can only be in one pair each week, and students should never work with someone ...
0
votes
0answers
5 views

Problem with JPA ordering by alphabetical order

I do have a problem when sorting using JPA 2.1.I would like to do a paged Criteria query for book entities and order them in an alphabetical order (lexicographical).when i tried this by the ...
1
vote
1answer
29 views

Sort with R5RS scheme in DrRacket

I'm learning scheme using DrRacket version 7.0.I have copied, and modified, the following procedure from this SO answer.#lang racket(define sort-asc-by-second(lambda (lst)(sort lst...
-3
votes
1answer
24 views

How to sort alphabet and numbers in python with maintaining their current order [on hold]

x=list(input())x.sort()print(x)My input : a2c1b3My output : abc123Output after sort will be : a1b2c3
-3
votes
0answers
32 views

Arrays swapping (sorting)

Given 2 arrays of integers. Check whether there is such a permutation between the elements of the arrays, which converts them into non-decreasing ones. If exists, then display it. How can I do this? ...
0
votes
1answer
47 views

Special Object filtering

I got an js-object with multiple child object that all are build the same way. They contain a "valid" and a "unique" property.I want to get a newObject that just includes .valid==true objects and ...
-4
votes
0answers
28 views

Sorted algorithm followed by random elements time complexity homework?

I have a homework that asks to work out the time complexity for bubble sort, insertion sort, selection sort, quick sort and merge sort.I would like to know how i can work out the time complexity of ...
0
votes
2answers
51 views

How are “key” functions more efficient than comparison functions in python's sorted?

In the Transforming Code into Beautiful, Idiomatic Python video (link starts at 10:07), the speaker says that using key instead of the cmp comparison function for sorting is more efficient. To ...

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,