
Audio Transcript Auto-generated
- 00:01 - 00:01
Hello, everyone.
- 00:03 - 00:07
Today's lesson is about a new term that is used
- 00:07 - 00:10
in programming, which is called Rick.
- 00:10 - 00:13
Urgent. What is the Riker Shin on?
- 00:13 - 00:15
How it is used in programming.
- 00:16 - 00:18
This is what we will understand today.
- 00:20 - 00:23
So by the end of this lesson, you should be
- 00:23 - 00:27
able to understand the term.
- 00:28 - 00:32
Rick. Urgent Riker Shin is a general term that is
- 00:32 - 00:34
used in all types off programming.
- 00:35 - 00:38
This is one off the main concepts that you should
- 00:39 - 00:42
understand. Like when we started with programming.
- 00:43 - 00:46
I told you that there are some basic terms that
- 00:46 - 00:47
you have to know.
- 00:48 - 00:56
Like valuables, data, types, functions, procedures Ah, ee Library.
- 00:57 - 01:01
Now you know, Ryker Jin is one off the basic
- 01:01 - 01:04
things that you should understand in programming.
- 01:06 - 01:13
Let's see what the Rick urgent is before I tell
- 01:14 - 01:16
you. What do we mean by rick?
- 01:16 - 01:22
Urgent. Let us take a look as examples off real
- 01:22 - 01:25
problems that you may solve you may need to solve
- 01:26 - 01:27
by typing accord of it on.
- 01:28 - 01:31
Let's see how you are going to think about it.
- 01:31 - 01:35
I'm gonna give you three different problems on.
- 01:35 - 01:38
Let's think together how you can.
- 01:38 - 01:41
I think you're gonna think about the code for this
- 01:42 - 01:44
problem. Good sake.
- 01:44 - 01:48
And got the 1st 1 If you have this picture
- 01:49 - 01:53
and you have to draw to type accord that will
- 01:53 - 01:58
draw this tree How you should start thinking about this
- 01:59 - 02:02
If you remember when we started with a small deal
- 02:03 - 02:08
on, we said the 1st 2 step in computational thinking
- 02:09 - 02:13
or one off the steps and computation of thinking is
- 02:14 - 02:17
to divide your problem into smaller ones.
- 02:18 - 02:19
If I look at the street, I will see it.
- 02:19 - 02:25
This is very complex and I can't from where shall
- 02:25 - 02:27
I start drawing from the bottom from the top?
- 02:28 - 02:29
From which part exactly.
- 02:31 - 02:35
But if I start thinking about this problem, that is
- 02:35 - 02:39
a huge problem and I want to divide it into
- 02:39 - 02:40
smaller ones.
- 02:41 - 02:42
I may find it easier.
- 02:44 - 02:49
I may think about drawing each different port alone.
- 02:51 - 02:57
If you can see most off the leaves or the
- 02:57 - 02:59
salt parts that you have in the street.
- 03:00 - 03:01
Most of it are the same.
- 03:03 - 03:07
It has almost the same structure, so I may divide
- 03:08 - 03:09
it into smaller problems.
- 03:10 - 03:15
I may start drawing, are thinking about accord that will
- 03:15 - 03:19
sort of a part of it, and then this code
- 03:20 - 03:25
may be repeated later on to draw the rest off
- 03:25 - 03:25
the tree.
- 03:26 - 03:30
I may modify a part of it, but most of
- 03:30 - 03:32
the code will be repeated here.
- 03:32 - 03:35
Why? Because most of the leaves that look the same.
- 03:37 - 03:38
Okay, let's take a look.
- 03:38 - 03:39
Another one.
- 03:42 - 03:43
Let's see this math problem.
- 03:45 - 03:49
If I have this number number N, I want to
- 03:49 - 03:54
divide it by two on after I divided by two.
- 03:54 - 04:00
The answer that I will get should be divided by
- 04:02 - 04:06
four, and I'm repeating the step two times.
- 04:07 - 04:11
So let's say, if I have been 10 will be
- 04:12 - 04:15
divided into 10 by five, and I should repeat it
- 04:16 - 04:19
again into town by fight, divided by its sorry 10
- 04:20 - 04:23
divided by two on then which is five Iranian.
- 04:24 - 04:28
And then this process should be divided again, and another
- 04:28 - 04:32
time I have to divide it by four in two
- 04:32 - 04:33
different steps.
- 04:33 - 04:35
If you look at this program, you will see that
- 04:36 - 04:39
this is divided into two different steps on each step
- 04:39 - 04:40
is divided into another, too.
- 04:41 - 04:44
But if you compare the right side and the left
- 04:44 - 04:47
side, you will see that it's the same.
- 04:49 - 04:55
I'm repeating the same steps in my program two times.
- 04:56 - 05:00
So why do you think I need to type the
- 05:00 - 05:01
code two times?
- 05:02 - 05:03
I don't have to.
- 05:04 - 05:08
I will type one function that will perform a part
- 05:08 - 05:12
of the calculation, and I may call this function again.
- 05:14 - 05:17
So as we took and functions, I may define a
- 05:18 - 05:21
function that will perform this calculation for me.
- 05:22 - 05:26
And I may call it again and again and again,
- 05:27 - 05:29
depending on what, the times that you need to repeat
- 05:30 - 05:34
the function within your program until it performs the whole
- 05:35 - 05:39
action or the until it solves the whole problem that
- 05:39 - 05:39
you have.
- 05:41 - 05:42
This is cold.
- 05:43 - 05:43
Rick Ergin.
- 05:44 - 05:45
I'm repeating.
- 05:46 - 05:50
I'm re calling the same function more than one time.
- 05:52 - 05:52
Another example.
- 05:57 - 05:59
Look at this curved line.
- 06:01 - 06:05
Do you think if I want to draw this curved
- 06:05 - 06:11
line, I have to repeat or to do the steps
- 06:11 - 06:12
from the beginning till the end?
- 06:13 - 06:17
If I try to make my problem's simpler, I may
- 06:17 - 06:21
divided into two parts, and I will see that it's
- 06:21 - 06:26
very clear that what I'm doing on the left side
- 06:26 - 06:28
is the same as the one that I'm doing on
- 06:28 - 06:29
the right side.
- 06:30 - 06:34
So it is enough for me to call a function
- 06:35 - 06:35
or toe.
- 06:36 - 06:42
Define a function that will draw the left half off
- 06:42 - 06:45
The curse of line on I will call it again.
- 06:46 - 06:52
Two. Draw the right half side off The curse of
- 06:52 - 06:56
line This is cold, Riker Shin.
- 06:58 - 07:01
So what is the Riker Shin on DDE?
- 07:02 - 07:06
How it is used an incursion Is the process off
- 07:06 - 07:12
subroutine dividing a problem into simpler parts and call it
- 07:13 - 07:16
calling itself to solve those simpler parts.
- 07:18 - 07:21
When we were talking about the tree, we said I
- 07:21 - 07:24
can divide two smaller ones and I can type only
- 07:25 - 07:29
one chord that will, or one function that will draw
- 07:29 - 07:32
a part of it to complete the rest of the
- 07:32 - 07:34
tree. I will keep calling the function.
- 07:35 - 07:40
This function will keep calling itself in a loop until
- 07:40 - 07:43
I'm done with drawing the whole tree.
- 07:45 - 07:48
This is the main idea behind using that occur jh
- 07:48 - 07:52
in. So it's a function that keeps calling get safe
- 07:53 - 07:58
instead off um, typing the coat more than once.
- 07:59 - 08:03
I just think about my problem, which is a very
- 08:04 - 08:04
complex one.
- 08:05 - 08:10
I just divided into smaller problems that I define on
- 08:10 - 08:15
Lee a sobriety and whether a function procedure, whatever you
- 08:15 - 08:19
need in your code on dysfunction will keep calling itself
- 08:20 - 08:24
many times until I'm done with drawing or performing whatever
- 08:25 - 08:26
I need from my coat.
- 08:27 - 08:30
This is, in general what every courage and is.
- 08:32 - 08:35
And as you know, this is very important in your
- 08:35 - 08:37
code. This will save your time.
- 08:38 - 08:43
You don't have to think about the problem A in
- 08:43 - 08:45
a complex way and keep repeating your code.
- 08:46 - 08:49
You just divided into smaller ones.
- 08:49 - 08:52
This is what we call the computation of thinking, and
- 08:53 - 08:55
you type a piece off court that will keep repeating
- 08:56 - 09:02
itself and calling itself until the whole problem is solved.
- 09:05 - 09:08
After we discussed what is the record gin and you
- 09:08 - 09:11
understand that the term let's see what your task is.
- 09:13 - 09:16
I want you to think about different types of problems
- 09:17 - 09:20
that could be sold by a recursive coat.
- 09:21 - 09:24
Can you find different problems on?
- 09:24 - 09:26
Please think about different problem types.
- 09:28 - 09:30
I don't want it to be related or similar to
- 09:30 - 09:32
the ones that I showed it to you.
- 09:32 - 09:36
Please think about new ideas, new problems that could be
- 09:37 - 09:39
sold by a recursive code.
- 09:41 - 09:44
I'm waiting for your answers, and I'm sure that you
- 09:44 - 09:47
can if I gonna find a lot of problems that
- 09:47 - 09:51
could be sold by incursion Waiting for your answers.
- 09:51 - 09:53
If you have any questions, just ask me.
- 09:54 - 09:54
Have a good day.