Skip to main content

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [sorting]

Use this tag when arranging items in order is the main focus of the code.

Filter by
Sorted by
Tagged with
7 votes
4 answers
585 views

My BRESort adaptive sorting engine in C

I've created BRESort - an adaptive sorting engine that dynamically selects optimal algorithms based on data patterns. It achieves 3.6-4.2x speedup over stdlib qsort ...
LazyCauchPotato's user avatar
4 votes
2 answers
390 views

Ordinary insertion sort vs. straight insertion sort in Java (benchmark)

Intro So this time I wanted to find out which of the two insertion sort flavours are faster: Code io.github.coderodde.util.StraightInsertionSort.java: ...
coderodde's user avatar
  • 31.9k
4 votes
3 answers
209 views

Field Sorting , ANSI-C/K&R 2ED, Exercise 5-17 brainstorming

This program is an expansion of the sorting utility built in previous chapters of K&R's 2nd edition of ANSI-C Programming. It parses command-line arguments to determine which fields to sort by and ...
rusty98k's user avatar
0 votes
3 answers
191 views

C# quicksort implementation (LeetCode Sort an Array)

I implemented quick sort after merge sort as part of LeetCode question for sorting an array. The solution code can be found at https://leetcode.com/problems/sort-an-array/solutions/7180269/i-...
Dovud Jo'rayev's user avatar
4 votes
2 answers
129 views

Custom RowSorter that sorts a Swing table containing data with unit suffixes

I would like to hear what you say about my custom RowSorter implementation. The following comparators should be used for the table columns: String, Double and Integer. The table data has postfixes and ...
Tobias Grothe's user avatar
5 votes
6 answers
2k views

Bubble sort with 10 random numbers

I want to make a bubble sorting algorithm of 10 random (non-repeating) numbers from 0-50. I changed many aspects of it while making it and finally got it to work, but I would like to see if there's ...
asuno__'s user avatar
  • 61
8 votes
5 answers
1k views

LeetCode 977: Squares of a sorted array, maintaining non-decreasing order

I tried solving the LeetCode question like many others, trying to incorporate the O(n) time complexity requirement. Squares of a Sorted Array Given an integer array ...
Littlejacob2603's user avatar
5 votes
2 answers
217 views

Sorting file names of a RAR split archive (v3 and v5)

This simple task of sorting a list of related RAR files of a split archive turned out to be more cumbersome than expected, since there are two versions of the RAR naming scheme, v3 and v5. v3 is like ...
viuser's user avatar
  • 629
7 votes
6 answers
1k views

Fast allocation-free alphanumeric comparer used for sorting

I was searching for C# comparers that can be used for natural sorting ("a9" comes before "a11"), but most solutions have a lot of allocations, quite unreadable code or are not ...
J.P.'s user avatar
  • 91
2 votes
1 answer
90 views

Multithreaded Merge Sort Using ForkJoin Framework

I've implemented a multithreaded merge sort using Java's ForkJoin framework, and I wanted to gather feedback on its correctness, efficiency, and scalability. Here's my implementation: ...
Akash Gupta's user avatar
-4 votes
1 answer
116 views

Pyramidal (Heap) sorting by D. Knuth

Help me with Pyramidal sorting by D. Knuth algorithm in C++. I would like to clarify if I followed the algorithm correctly. The code works. I have the function, but I'm not sure if my code fully ...
Loly18's user avatar
  • 1
3 votes
0 answers
118 views

Comparing two Tree sort algorithm variations implemented in Java

I have this repository. It contains three variations of a simple sorting algorithm for integer keys. The idea is that we keep a balanced BST in which each node holds the integer key and its frequency. ...
coderodde's user avatar
  • 31.9k
2 votes
1 answer
71 views

Advent of Code 2022 Day 13 Solution in C: Sorting and parsing nested list

Link to Original Problem: Advent of Code 2022 Day 13 Question Summary: The task involves sorting and parsing nested lists, with two parts: Determine pairs in the correct order and calculate the sum ...
fish_brain's user avatar
3 votes
1 answer
134 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: ...
Arjun Kumar's user avatar
4 votes
1 answer
145 views

Efficient least-significant digit (LSD) radix sort for int keys in Java

(This post has a continuation post.) This one is my attempt at LSD radix sort: Code com.github.coderodde.util.LSDRadixsort.java: ...
coderodde's user avatar
  • 31.9k

15 30 50 per page
1
2 3 4 5
78
Morty Proxy This is a proxified and sanitized view of the page, visit original site.