In this video, I will show you how to get the value or element in an array at an index using the iterative way and recursion. For example, get([a,b,c], 2) will return c because that is the value of the array at index 2.
What is recursion? Recursion is a function that calls upon itself. Here, we write a function that calls upon itself and to get the value in an array or list at a specific index using recursion. While it is easy to use a for loop or while loop to do this, it is important that you understand these recursion steps to have a strong foundation to learn more complex recursive algorithm in the future.
In this next video, I will show you how to reverse a string and reverse an array using a for loop and using recursion.
LIKE & SUBSCRIBE:
🔴 My Channel: / quocdatphung
🔴 My second channel: / @clear_your_mind123