recursion

Độ phổ biến: #10,969

recursion

recursion

Ghi chú cá nhân

Lưu trong trình duyệt này. Ghi chú sẽ hiện trước khi bạn học hoặc ôn từ này.

Đang tải…

Cách sử dụng

Recursion is a word that is used in computer programming to describe a process where a function calls itself over and over again. It's similar to a loop, but instead of repeating a set of instructions, the function repeats a specific set of steps until a certain condition is met. For example, if you wanted to calculate the factorial of a number, you could use recursion. The factorial of a number is the product of all the numbers from 1 to that number. So, to find the factorial of 5, you would multiply 5 by the factorial of 4, which is 4 times the factorial of 3, and so on until you reach the factorial of 1, which is just 1. Recursion can be a very powerful tool in programming, but it can also be tricky to use correctly. It's important to make sure your recursive function has a base case, or stopping point, to prevent it from running indefinitely.

Từ đồng nghĩa

Iterate means to repeat a process or set of actions.

For example, when we want to print the first ten even numbers, we use a loop that iterates ten times.

In simple words, iterate is used for repeating a fixed set of actions, while recursion is used for solving a problem by breaking it down into smaller sub-problems and solving each one recursively.

Mở từ: Iterate →

What do all languages...

What do all languages...

Xem trên YouTube ↗
Suffering produces a recursion to the tribe, to one's own kind. When a lot of people suffer, tribes lose their head.
Giles Foden · English Author

Ron Eglash: The fractals...

Ron Eglash: The fractals...

Xem trên YouTube ↗

Cài đặt Letteree

Thêm Letteree vào màn hình chính hoặc máy tính. Ứng dụng mở trong cửa sổ riêng, khởi động nhanh hơn và các trang bạn đã xem vẫn mở được khi không có mạng.