Consider the following code to find the K th minimum element of an array:
FindKthMin(A[], k)
{
A = Sort(A);
return A[k];
}
Could it be an algorithm without specifying the sort
details?
Can we say algorithm has no meaning without specifying the instruction set (target machine and its basic instruction set)
For example in BubbleSort
should we specify the Swap(..)
or Add(..)
details? I mean what are those atomic instructions which would stop us to go further?
Or what is a formal definition for an algorithm step? Is there any general mathematical definition for it (like functions or something)?