Skip to main content

All Questions

Tagged with
4 votes
2 answers
110 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
2 votes
1 answer
79 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
3 votes
0 answers
98 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
  • 30.2k
3 votes
1 answer
132 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
  • 30.2k
1 vote
0 answers
23 views

Determine top t values with few calls to order(), a given procedure to order k values, Java take 2

My 2nd take of the problem in Determine top t values with few calls to order(), a given procedure to order k values: Given an array and a procedure to order \$k\$ ...
greybeard's user avatar
  • 7,189
3 votes
1 answer
88 views

Creating Worst-Case Scenario for QuickSort using Middle Pivot in Java

I've implemented a solution to generate the worst-case scenario for QuickSort using the middle pivot strategy in Java. The goal is to rearrange an input array to produce the worst performance during ...
Lydia Yuan's user avatar
5 votes
2 answers
161 views

Print the three most occurring chars in Java using streams

The three characters that occurs most in a given string should be printed by using streams/lambdas (functional programming). The order of characters that occur equally often should be preserved. My ...
Tobias Grothe's user avatar
2 votes
1 answer
85 views

Implementing an improved merge sort that uses insertion sort, with "levels" - Would this work correctly?

We were asked to improve the merge sort algorithm by introducing insertion sort to the code. We have been tasked with doing this by utilising a "levels" logic. Here is the exact description ...
Preatorius's user avatar
3 votes
2 answers
216 views

Counting duplicate elements in two sorted arrays

I've been working on an assignment that involves optimizing a duplicate finding algorithm for sorted arrays, and I'd like to get your thoughts on the implementation. Here's the code I've come up with: ...
Bryan C's user avatar
  • 31
4 votes
4 answers
1k views

Quick Sort Done Lucidly

I've been away from Programming and the Tech Industry for sometime. I thought I'd look at and try some of the older basic stuff. I bushed up to QuickSort and found most existing implementations of it, ...
Amal Krishnan's user avatar
1 vote
1 answer
117 views

Queue-mergesort: a mergesort that does optimal number of comparisons in the worst case in Java

Here is the code for queue-mergesort by Mordecai J. Golin and Robert Sedgewick: com.github.coderodde.util.QueueMergesort.java: ...
coderodde's user avatar
  • 30.2k
2 votes
2 answers
193 views

Quick Sort Program

Quick sort is a sorting algorithm in which we select any random element as pivot from the array and we do the partition of the array around that pivot. Basically we place all the elements smaller than ...
Strange Alchemist's user avatar
2 votes
1 answer
60 views

Merge Sort with Minimum Sufficient Variables, Verbosity and better Space Complexity

The majority of merge sort implementations searched online are provided with unnecessary variables and code lines. Here is an attempt to reduce that. However, does passing back the subArray as return ...
Thomas Mathew's user avatar
2 votes
1 answer
356 views

Sorting visualizer using Java Swing

I programmed a little sorting visualizer a while back and I have been meaning to get some feedback on the overall implementation and on what I could do better to have cleaner code or a "best ...
morloq's user avatar
  • 119
1 vote
1 answer
82 views

Insertion Sorting Algorithm

I am new to data structures and algorithms. I have just implemented an insertion sorting algorithm. I just want to make sure if my code is alright. ...
Md Anik's user avatar
  • 13

15 30 50 per page
1
2 3 4 5
18