diff --git a/cur/programming/8-recursive-reporters/1-recursive-reporters/1-counting-trees.es.html b/cur/programming/8-recursive-reporters/1-recursive-reporters/1-counting-trees.es.html index e37eea4ac9..fd002c952d 100644 --- a/cur/programming/8-recursive-reporters/1-recursive-reporters/1-counting-trees.es.html +++ b/cur/programming/8-recursive-reporters/1-recursive-reporters/1-counting-trees.es.html @@ -18,7 +18,7 @@
nivel | @@ -54,8 +54,8 @@
---|
factorial
bloque usando un reportero recursivo.factorial
block using a recursive reporter.
Word processing programs count the number of words and letters in documents. One way to count the number of letters in a phrase is to use a recursive reporter.
+join words
block. This block inputs a list and outputs a string sentence, with spaces:Again, I am concerned with teaching recursion as "a more complicated way to do what you already know how to do." I don't think my join words
works because it can be done so much more quickly non-recursively by using combine
. I do like letter count
though because it does simplify the code. --MF
@@ -90,7 +92,6 @@
I need a suggestion to change this. Or is the suggestion to delete the join-words task? Any other things to replace it? Also we should use "empty?" when possible, not "length = 0". -BK
The list operations all but first of
and in front of
are frequently used in recursive reporters.
Map
Patternmap
pattern, but comes close. In that case, you can't use map
, but your understanding of the pattern still helps. Here's an example:Shouldn't pairup
come before odd numbered
? --MF, 9/26/18
BH:that's ok, but take ALL the text from #2 and move it here with this. --MF, 6/17/20
+The fill in the blank is not something we’ve seen before in the curriculum. Seems out of place. --Michelle via MF, 4/22/22
Shouldn't pairup
come before odd numbered
? --MF, 9/26/18
BH:that's ok, but take ALL the text from #2 and move it here with this. --MF, 6/17/20
-The fill in the blank is not something we’ve seen before in the curriculum. Seems out of place. --Michelle via MF, 4/22/22
pairup
block:mantener
Haz los siguientes ejercicios usando recursividad, no funciones de orden superior.
evens
.evens
.termina en-a
que tome una lista de palabras como entrada y reporte una lista de esas palabras de la entrada cuya última letra es a.mantener
mapear
, mantener
y combinar
es un gran logro. Sin embargo, cada uno de estos bloques solo generaliza un patrón simple. Algunas personas piensan ni siquiera aprender a usar las funciones de orden superior son en la universidad, ni mucho menos a construirlasn. 🎉 ¡Enhorabuena! 👏 ¡Completaste La belleza y alegría de la Informática (BJC)! 🏆
+ Crear mapear
, mantener
y combinar
es un gran logro. Sin embargo, cada uno de estos bloques solo generaliza un patrón simple. Algunas personas piensan ni siquiera aprender a usar las funciones de orden superior son en la universidad, ni mucho menos a construirlasn. 🎉 ¡Enhorabuena! 👏 ¡Completaste La belleza y alegría de la Informática (BJC)! 🏆
Keep
Do the following exercises using recursion, not higher order functions.
evens
.ends-e
that takes a list of words as input, and reports a list of those words from the input whose last letter is e.evens
.ends-e
that takes a list of words as input, and reports a list of those words from the input whose last letter is e.numbers
that takes a list of mixed words and numbers as input, and reports a list of just the numbers from the input list.Estás a punto de averiguar cuántas llamadas recursivas se necesitan para calcular un valor en el triángulo de Pascal.
pascal
para llevar la cuenta de cuántas veces se ejecuta el bloque.pascal
al calcular ?Muchas de las llamadas recursivas son redundantes. Por ejemplo: llamará a muchas veces, pidiendo la misma información.
pascal
, de modo que, cuando se vuelvan a proporcionar las mismas entradas, la función busque el valor guardado en lugar de realizar más llamadas recursivas.pascal
que se usa mucho:Crea una versión de pascal
que use la fórmula. Compara la eficiencia de esta versión con la versión recursiva y determina si cada versión se ejecuta en tiempo constante, tiempo lineal, tiempo cuadrático o tiempo exponencial.
pascal
que se usa mucho:
+ Crea una versión de pascal
que use la fórmula. Compara la eficiencia de esta versión con la versión recursiva y determina si cada versión se ejecuta en tiempo constante, tiempo lineal, tiempo cuadrático o tiempo exponencial.
You are about to figure out how many recursive calls are needed to compute a value in Pascal's Triangle.
pascal
block to keep count of how many times the block is executed.pascal
block called when calculating ?pascal(7,2) + pascal(7,3) + pascal(7,3) + pascal(7,4) + pascal(7,3) + pascal(7,4) + pascal(7,4) + pascal(7,5)
pascal
, so that when the same inputs are given again, the function looks up the saved value instead of making more recursive calls.pascal
that is often used: Build a version of pascal
that uses the formula. Compare the efficiency of this version to the recursive version, and determine whether each version runs in constant time, linear time, quadratic time, or exponential time.
pascal
that is often used:
+ Build a version of pascal
that uses the formula. Compare the efficiency of this version to the recursive version, and determine whether each version runs in constant time, linear time, quadratic time, or exponential time.
ordenación reportera
toma una lista como entrada y genera una nueva lista de los mismos elementos en orden alfabético. Prueba tu algoritmo usando nombres y números.ordenación reportera
toma una lista como entrada y genera una nueva lista de los mismos elementos en orden alfabético. Prueba tu algoritmo usando nombres y números.
+ sort
reporter takes a list as input and outputs a new list of the same elements in alphabetical order. Test your algorithm using both names and numbers.sort
reporter takes a list as input and outputs a new list of the same elements in alphabetical order. Test your algorithm using both names and numbers.
+ earliest in
block. For names, this returns the first name alphabetically in a list: