
Rekurencja i iteracja
Presentation
•
Computers
•
9th - 12th Grade
•
Practice Problem
•
Hard
Radek Delimata
Used 6+ times
FREE Resource
5 Slides • 0 Questions
1
Rekurencja i iteracja:
porównanie i zastosowanie w programowaniu
2
Rekurencja i iteracja to dwie podstawowe techniki programowania.
Obie techniki służą do wykonywania powtarzających się operacji w programie.
W tej prezentacji porównamy rekurencję i iterację, a także omówimy ich zastosowanie w programowaniu.
Wprowadzenie
3
Rekurencja to technika programowania,
w której funkcja wywołuje samą siebie z mniejszymi argumentami.
Przykład: funkcja silnia n! = n (n-1) (n-2) ... 1 może być obliczona rekurencyjnie
jako n! = n * (n-1)!
Wadą rekurencji jest to, że może być mniej wydajna niż iteracja i wymaga większej pamięci.
Rekurencja
4
Iteracja to technika programowania, w której powtarzamy określone czynności za pomocą pętli.
Przykład: wyświetlanie wszystkich liczb od 1 do 10 może być osiągnięte za pomocą pętli for w Pythonie:
for i in range(1,11):
print(i)
Iteracja jest zazwyczaj bardziej wydajna niż rekurencja i wymaga mniejszej ilości pamięci.
Wadą iteracji jest to, że w niektórych przypadkach może być mniej czytelna niż rekurencja.
Iteracja
5
Rekurencja i iteracja służą do wykonywania powtarzających się operacji w programie.
Rekurencja polega na wywoływaniu funkcji samej w sobie z mniejszymi argumentami, podczas gdy iteracja polega na powtarzaniu określonych czynności za pomocą pętli.
Rekurencja jest użyteczna w rozwiązywaniu problemów, które są naturalnie zdefiniowane rekurencyjnie, takich jak drzewa i grafy, podczas gdy iteracja jest użyteczna w rozwiązywaniu problemów, które można rozwiązać za pomocą pętli.
Rekurencja może być mniej wydajna niż iteracja i wymaga większej ilości pamięci, podczas gdy iteracja jest zazwyczaj bardziej wydajna i wymaga mniejszej ilości pamięci.
Porównanie rekurencji i iteracji
Rekurencja i iteracja:
porównanie i zastosowanie w programowaniu
Show answer
Auto Play
Slide 1 / 5
SLIDE
Similar Resources on Wayground
7 questions
Niepokalane Poczęcie
Presentation
•
8th - 12th Grade
4 questions
KHTN9 _CÔNG_CÔNG SUẤT
Presentation
•
9th Grade - University
5 questions
Książka też jest kobietą - Quiz
Presentation
•
9th - 12th Grade
4 questions
Nervous System
Presentation
•
KG - University
7 questions
Lesson 4-4 Part 2 (Academic)
Presentation
•
10th - 12th Grade
8 questions
Homework Reading: 2.8 Progressive African American Rights for September 30th, 2021
Presentation
•
9th - 12th Grade
6 questions
Complicaciones postoperatorias
Presentation
•
KG
6 questions
Solving Inequalities in One Variable
Presentation
•
9th - 12th Grade
Popular Resources on Wayground
6 questions
Secondary Safety Quiz
Presentation
•
9th - 12th Grade
10 questions
Afterschool Activities & Sports
Quiz
•
6th - 8th Grade
19 questions
ROAR Week 2026
Quiz
•
9th - 12th Grade
20 questions
Lab Safety Quiz
Quiz
•
6th Grade
15 questions
Cool Tool:Chromebook
Quiz
•
6th - 8th Grade
22 questions
would you rather
Quiz
•
3rd - 11th Grade
21 questions
Continents and Oceans
Quiz
•
6th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
Discover more resources for Computers
20 questions
Early Computing
Quiz
•
7th - 12th Grade
10 questions
Exploring the Parts of a Computer
Interactive video
•
6th - 10th Grade
10 questions
Navigating Digital Citizenship and Online Safety
Interactive video
•
6th - 10th Grade
20 questions
Binary Numbers
Quiz
•
11th Grade
10 questions
Mastering Proper Keyboarding Techniques
Interactive video
•
6th - 10th Grade