Recursion in Python: traversing a list with indices | 21/34 | UPV

preview_player
Показать описание
Título: Recursion in Python: traversing a list with indices

Descripción: In this video we learn how to work with lists using recursive algorithms and indices for efficiency. We explore a method that analyzes one element per iteration, using two positional parameters to mark the beginning and end of our analysis.

This approach is more efficient than using slices because it modifies an index instead of copying the list every time. The user can call this method easily by providing default parameters from the beginning to the end of the list.

We also discuss alternative approaches, including top-down traversal with one or two parameters, which allow us to analyze the full list and reach the base case of an empty list.

Autor/a: GALINDO JIMENEZ CARLOS SANTIAGO

#python #SEAMIC #recursive algorithms #recursive traversal algorithm #recursion with lists #CS2
Рекомендации по теме
welcome to shbcf.ru