From Rice Theor , you can't even decide at all whether a piece of code is a sorting function or not while studying the code. You can, of course, find out if it has a sorting effect for some finite set of inputs by running it with these inputs and examining the results.
Perhaps you can do something for the specific case of this target sorting algorithm by examining the array that is sorted during sorting, checking the invariants specific to the target algorithm. For example, each call in recursive quicksort will sort the subarray.
==================================================== ================
Following the comments, I suggest looking at the home page of Ahmad Taherkhani . He continued research in this area, including a 2012 article on this topic.
source share