C++ Recursion with Vectors

Опубликовано: 14 Октябрь 2025
на канале: Kenny Yip Coding
1,009
31

Recursion and Recursive Functions in C++. Recursive function is a function that calls itself. In this video we will go over how to traverse through a vector in a recursive function. First we would need a base case which is usually when the index reaches out of bounds (index == size). Then we need to create a recursive step which is the index. With each recursive call, we pass index + 1, which increments the index towards the base case (index == size).

If you need to review these topics:
Functions:    • C++ Functions  
Pass by Value vs Reference:    • C++ Functions Pass by Value or Reference  
Function Overloading:    • C++ Function Overloading  
Const Reference:    • C++ Const Reference  
Templates and Generics:    • C++ Templates and Generics Functions  
Recursion:    • Recursion in C++  

C++ Playlist:
   • C++ Programming Tutorial  

Github Repo for C++ Code:
https://github.com/ImKennyYip/cpp

Install C++ with VS Code:
   • How to set up C++ in Visual Studio Code  

Subscribe for more coding tutorials 😄!

⭐ If you enjoyed the tutorial and would like to support the channel, you can do so here 💖: https://buymeacoffee.com/kennyyipcoding