All Questions
Tagged with sorting javascript
126 questions
3
votes
1
answer
123
views
Sorting the divisors of a given number
I am trying to sort all the divisors of a given number in the most efficient way.
Below is my code for sorting the divisors:
...
3
votes
1
answer
136
views
How can I condense my code in node.js for sorting unique values within an array?
Kattis problem - ("I've been everywhere")
I would highly recommend looking at the problem through the link, however I will summarize it a bit here and explain the functionality of each part ...
3
votes
1
answer
102
views
Function that sorts nestedArray[][]'s
I'm fairly new to coding and am trying to learn more about best practices. I wanted to have an nestedArray of objectArrays, and I wanted to be able to sort the elements in each objectArray based on ...
0
votes
1
answer
297
views
bubble sort algorithm with nested loops performs better than with one loop JS
Here are 2 bubble sort algorithms:
1:
...
1
vote
6
answers
257
views
Find first and last matches on a sorted list
I needed a function to find the first and last indices into a sorted list corresponding to a given value (roughly similar to C++'s equal_range()).
This is the ...
0
votes
1
answer
145
views
Six different, concise (and hopefuly readable), sorting algorithms using ES6+ idioms, with some basic unit testing
I'm practicing js, unit testing, and algorithms, so implementing some of the common sorting algorithms and doing some basic unit testing on them seemed like a good exercise.
I'm also trying to use ...
2
votes
2
answers
3k
views
Sorting table rows visually with animation while keeping them intact in the DOM
I have a table which i want to sort the rows visually according to a column while the rows remain intact in the DOM structure. So nodes aren't moving in the DOM or getting replaced with eachother at ...
0
votes
1
answer
215
views
A New Sorting Algorithm
I have designed an Algorithm for sorting numbers.
This algorithm works by sorting an array of any length with random, non-repeating whole numbers in a linear manner by ascending order.
Under the ...
2
votes
2
answers
166
views
Function to find substring in a list of strings and add them to the resulting list
I am trying to look for a substring in a list of strings. My end result is an array that contains the presence of substring first based on course.name and then ...
2
votes
3
answers
905
views
Sort one array base on another array
The problem is as below:
Two archery teams A and B compete with the same number of members. If the score of team A[i] is higher than that of team B[i], the total score of team A will be +1, so given ...
0
votes
1
answer
97
views
custom array sorting algorithm
So I came up with a "new" sorting algorithm:
...
0
votes
2
answers
2k
views
Sort table with ascending or descending order without a library
This is my first day coding, and I need help with sorting a table in ascending/descending order. The idea is that when a column is clicked it will sort in ascending order, and then it is clicked again ...
2
votes
2
answers
1k
views
Using JavaScript, given a JSON value, recursively find all JSON objects, then sort keys in-place
Some background: JavaScript is not my primary language, so I'm looking to get some constructive criticism here.
I built a tiny single page HTML app that pretty prints JSON text. It's very useful when ...
3
votes
2
answers
234
views
Sorting an array of positive integers including 0 much faster than Radix Sort
I was working on an Limit Order Book structure in JS and came up with this algorithm. I am pretty sure this must have already been implemented but couldn't even find a clue over the web.
The thing is, ...
2
votes
1
answer
87
views
Generating a performance report for clans in Clash Royale
The following code generates a report showing performance of clan members in a game called Clash Royale.
Everything is pretty self-explanatory, we are working with a lot of https requests, arrays and ...