Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
2 votes
1 answer
72 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
3 votes
2 answers
392 views

Check whether array is sorted recursively

I'm trying to implement isSorted method checking whether given array is sorted recursively. I've written two types, one is similar to merge sort logic, the another ...
Soner from The Ottoman Empire's user avatar
2 votes
0 answers
373 views

Follow-up 1: Compare 2 unordered, rooted trees for shape-isomorphism

The previous post can be found here. In the previous post I tried to solve an exercise but found through the answer of Peilonrayz a bug in the code and 2 more while fixing it. These have now been ...
Philipp Doerner's user avatar
3 votes
2 answers
1k views

Compare 2 unordered, rooted trees for shape-isomorphism

I'm currently working through "Algorithms in java" by Robert Sedgewick (3rd edition, german version) on my own and am trying to solve one of the exercises there. Edit: This question now also has a ...
Philipp Doerner's user avatar
5 votes
3 answers
2k views

Merge Sort Implementation in Java (that seems slow...)

I decided to write my own implementation of merge sort. Here is the code: ...
TheCoffeeCup's user avatar
  • 9,486
2 votes
2 answers
7k views

Simplest quick sort using one 19-line function

This will later be be posted on my website to explain quick sort so I would like how I could improve the readability and simplicity of this demo class. I do not like my use of the stack (meaning this ...
Lee Allan's user avatar
  • 353