Рекурсия: различия между версиями

Материал из Энциклопедия вычислительного мышлении
Перейти к навигации Перейти к поиску
Строка 1: Строка 1:
{{Concept
+
{{Понятие
 
|Description=Рекурсия — определение, описание, изображение какого-либо объекта или процесса внутри самого этого объекта или процесса, то есть ситуация, когда объект является частью самого себя.
 
|Description=Рекурсия — определение, описание, изображение какого-либо объекта или процесса внутри самого этого объекта или процесса, то есть ситуация, когда объект является частью самого себя.
 
В программировании чаще всего - вызов функцией себя самой.
 
В программировании чаще всего - вызов функцией себя самой.
Строка 8: Строка 8:
 
When you're thinking about a recursive procedure, it's especially important to remember that each invocation of a procedure has its own local variables. It's possible to get confused about this because, of course, if a procedure invokes itself as a subprocedure, each invocation uses the same names for local variables. For example, each invocation of downup has a local variable (its input) named word. But each invocation has a separate input variable.  
 
When you're thinking about a recursive procedure, it's especially important to remember that each invocation of a procedure has its own local variables. It's possible to get confused about this because, of course, if a procedure invokes itself as a subprocedure, each invocation uses the same names for local variables. For example, each invocation of downup has a local variable (its input) named word. But each invocation has a separate input variable.  
  
How Recursion Works В книге Simple Scheme
+
; Маленькие человечки: How Recursion Works В книге Simple Scheme
 
+
: The crowning achievement of the little-people model is explaining recursion. Remember that every time you call a procedure, a little person is hired to compute the result. If you want to know (+ 2 (+ 3 4)), there are two separate plus specialists involved.
The crowning achievement of the little-people model is explaining recursion. Remember that every time you call a procedure, a little person is hired to compute the result. If you want to know (+ 2 (+ 3 4)), there are two separate plus specialists involved.
 
 
|FieldActivity=Computational Thinker
 
|FieldActivity=Computational Thinker
|Возрастная категория=9
+
|Возрастная категория=11
|Ages=10
+
|Examples=https://scratch.mit.edu/projects/334694805/
 
}}
 
}}

Версия 15:52, 9 октября 2019

Описание Рекурсия — определение, описание, изображение какого-либо объекта или процесса внутри самого этого объекта или процесса, то есть ситуация, когда объект является частью самого себя.

В программировании чаще всего - вызов функцией себя самой.

Введение в рекурсию в книге Харви о стиле Лого - http://people.eecs.berkeley.edu/~bh/v1ch7/recur1.html


When you're thinking about a recursive procedure, it's especially important to remember that each invocation of a procedure has its own local variables. It's possible to get confused about this because, of course, if a procedure invokes itself as a subprocedure, each invocation uses the same names for local variables. For example, each invocation of downup has a local variable (its input) named word. But each invocation has a separate input variable.

Маленькие человечки
How Recursion Works В книге Simple Scheme
The crowning achievement of the little-people model is explaining recursion. Remember that every time you call a procedure, a little person is hired to compute the result. If you want to know (+ 2 (+ 3 4)), there are two separate plus specialists involved.
Область знаний
Область использования (ISTE) Computational Thinker
Возрастная категория 11
Примеры реализации Использование цепочки свойств «Ehttps://scratch.mit.edu/projects/334694805/amples» недопустимо в семантической аннотации.
Авторы
Поясняющее видео
Близкие понятия
Среды и средства для освоения понятия