Category "sorting"

Minimum moves to transform a list so that each element equals its own frequency

Given a sorted array like [1,2,4,4,4]. Each element in the array should occur exactly same number of times as element. For Example 1 should occur 1 time, 2 shou

Best way to sort BOTH prefix and suffix with custom sorting

So I have a list of codes, something like: (I.-) (I.+) (I.0) (B.+) (B.0) (B.-) ... (No value) (N/A) I was able to sort them but we have a "custom requirement" t

Sort array of objects by string property value

I have an array of JavaScript objects: var objs = [ { first_nom: 'Lazslo', last_nom: 'Jamf' }, { first_nom: 'Pig', last_nom: 'Bodine' },

Elastic search script sort text as Number

I have an Elastic search field ID which is a Number but set in the index as a "text". I cannot change the index because of the huge volume of data to reload. I

All combination of 2 lists in ansible

I have 2 variables as a list in ansible host_list: - 1.1.1.1 - 2.2.2.2 port_list: - 443 - 80 and I want to get the 3rd variable as a list of l

Recycler View List Sort position saving notepad app

In my program I added code to move the list items around but for example if I move shopping list above Test 123 and fully close the app the positioning resets

What determines the item order when converting a set to a list?

I know there are several similar questions, but I haven't found one yet that talks about what I would like to know. If this is a duplicate, please point it out.

Double lexicographic sorting of binary (0-1) matrices

I want to sort a binary matrix so that its columns and rows are both in lexicographical order by switching rows and columns. In other words, I need a double-lex

Convert a Text File into an Array, without the '/n'

I am trying to code a sorting code, very basic, using the python "(sorted)" method. For this code, I am trying to import the words to be sorted by using a text

Shuffle nested arrays in Javascript

I'm trying to sort multiple arrays within an array (which also has to be shuffled). A simplified example is: let toShuffle = [ [1, 2, 3, 4, 5], [9, 8, 7, 6, 5],

Sort an array except one element in JavaScript

I have an array and I am sorting it but I need to sort everything except one element of my array. My array is: var Comparison = [ {key: "None", value: "No

TYPO3 10 Exbase bidirectional m:n relation sorting

In my extension I have two models team members (parent) and expertise (child). The bidirectional relationsship between the two models is stored in an intermedia

Grouping/Clustering Rectangles

I have a list of shapes (list of points) e.g. rectangles which I want to group/cluster together. This is what I have: And this is what I want to achieve. How

What is the role of the temp integer in the bubble sort code

int[] array = {4, 5, 7, 6, 9, 10,67,6,45}; for (int i = 0; i < array.length; i++) { for (int j = i+1; j < array.length; j++) { if (array[i] &g

how to convert binary heap sort to d_ary heap sort?

Hi I have an algorithm that uses binary tree to heapify and then sort the list i need to convert this sort algorithm to change into d-heap or d-ary heap or k-ar

Sort flat array by multiple rules

I would like some help regarding my sort function for an array as it is not working as I expected. This function is to sort array of [0,1,2,3,4,...23] into arra

pub.document.sortDocuments not sorting

I am stuck, I had this working last week now I have changed something and it will not work! I have a simple flow service as follows: pub.file.getFile pub.f

sort() not affecting original array while inside foreach loop

I have array with structure: Array ( [months] => Array ( [01] => Array ( [0] => 16

Sorting artifacts using aql and cleanup old artifacts

I'm trying to sort the list of artifacts from jfrog artifactory but getting (The requested URL returned error: 400 Bad Request), in the jfrog documentation (htt

Simple custom sorting function for jQuery DataTables

Numeric sorting is not working on my dataset. So I made a custom sorting that converts whole string into number then sorts based on that, but for some reasons i