Overview of program in memory
Before diving into recursion, we need to understand what programs written in languages like C++, Java, etc., look like in computer memory when executed. Understanding their low-level structure and functioning is the key to understanding recursion. From writing the code to the actual execution, a program goes through the following stages.
Writing the source code
Source code is a collection of high-level language instructions written by a programmer. This code is entirely human-readable, using specific syntax and keywords (like if, while, int) to define the program's logic. It is stored as simple text files on the storage drive. Because the CPU can only understand elementary binary operations, this human-centric code must be translated. This need for translation initiates the next stage, where the high-level instructions are converted into the CPU's native language.
Liking the course? Check our discounted plans to continue learning.