

Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity
Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium
Esta página no es visible en la vista previa
¡No te pierdas las partes importantes!


Instrucciones: Resolver cada uno de los siguientes ejercicios utilizando una función recursiva. Entregables:
Ejemplo: countX("xxhixx") → 4 countX("xhixhix") → 3 countX("hi") → 0 Ejercicio 5 – Contar 11’s en un Array Given an array of ints, compute recursively the number of times that the value 11 appears in the array. We'll use the convention of considering only the part of the array that begins at the given index. In this way, a recursive call can pass index+1 to move down the array. The initial call will pass in index as 0. Ejemplo: array11([1, 2, 11], 0) → 1 array11([11, 11], 0) → 2 array11([1, 2, 3, 4], 0) → 0