Isawyouoo wrote:actually it's possible
No it isn't.
I can only suppose you are using the formal definition of an algorithm, like the one in your original post ("this is an algorithm that calculate factorial,")
In the vast universe of programming the cases of actual implementation of those methods represents such a small fraction of the total code base to be effectively zero. I would not be surprised if the percentage is even smaller than what it represented by winning the grand prize in a national lottery.
In contrast then are a vast, vast number of "algorithms" in the general sense that do not have a formal definition. They solve business, research and even educational problems but one cannot 'define' them because they are unique.
As an example following is some code that I just copied from my computer. What is the actual text that you expect your program to report for the "algorithm" for this?
public static void test(Object s)
Date daysAgo = Date.from(Instant.now().plus(-30L, ChronoUnit.DAYS));
System.out.println("Days ago=" + daysAgo);