Can someone give me tips on algorithms
For example I see a function without any comments on it but say some complicated nested for-loop and weird if statements. Is there any easy way in deciephering what the code means without subsitution for what ever is needed. For example, I come across a weird program for GCF. This person did it in an akward way. Is there a way to deciepher it without plugging in numbers?
Also one more question, when thinking up algorithms to solve equations. Whats the best way in thinking up algorithms that are effiecient and easy to code without asking someone for help?
For example I am given a precondition and a postcondition that basically takes a number in and the post condition is returning the Fibonacci number of it. How would someone go on figuring out how to write the algorithm of the code?