Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,740 --> 00:00:09,770
Welcome, ladies and gentlemen, to another very, very interesting exercise in our recursion section.
2
00:00:10,640 --> 00:00:17,300
So in this video, what we are going to do is basically to write some function.
3
00:00:17,390 --> 00:00:25,250
OK, this is basically these function will have to be implemented using some recursive concept.
4
00:00:25,820 --> 00:00:33,920
And all these function will have to do is just to calculate the number of appearances of a given character
5
00:00:33,920 --> 00:00:35,570
in a sequence.
6
00:00:36,290 --> 00:00:44,510
And you are going to read a sequence of different characters and you don't know in advance how many
7
00:00:44,510 --> 00:00:51,140
characters will be in this particular sequence, because that's something that we want to give the user
8
00:00:51,140 --> 00:00:51,930
to decide.
9
00:00:52,460 --> 00:01:02,360
So basically saying the user will insert different characters, OK, up until he inserts these character
10
00:01:02,360 --> 00:01:10,670
of dollar in, once the user inserts the last character, which will be probably our stopping condition,
11
00:01:11,090 --> 00:01:20,060
once the user does that, then we are going to return the number of appearances, the number of occurrences
12
00:01:20,270 --> 00:01:28,250
of a given character that these function is going to receive and the function is going to calculate
13
00:01:28,250 --> 00:01:29,560
and to return.
14
00:01:29,570 --> 00:01:39,020
Finally, what is the number of times that these given character has occurred in the sequence that the
15
00:01:39,020 --> 00:01:41,120
user has inserted?
16
00:01:42,020 --> 00:01:46,040
So, for example, let's take a look at these examples.
17
00:01:46,040 --> 00:01:46,960
So example.
18
00:01:47,900 --> 00:01:56,090
So here we can see that a given character see OK is passed to the function and then the user specifies
19
00:01:56,090 --> 00:02:04,160
these little nice sequence of A, B, C, A, C and A dollar, and then the function in a recursive
20
00:02:04,160 --> 00:02:12,470
manner will simply return to since we have here two characters which are a C, OK, and that's the character
21
00:02:12,470 --> 00:02:14,210
we are comparing with.
22
00:02:15,110 --> 00:02:15,740
Awesome.
23
00:02:15,760 --> 00:02:23,330
So I hope that the instructions are clear to you and you understand why do you have to do and now basically
24
00:02:23,660 --> 00:02:29,840
take a few minutes and try to think of the solution, try to come up with a good idea, with a good
25
00:02:31,460 --> 00:02:34,550
with a good strategy to how you can solve it.
26
00:02:34,730 --> 00:02:41,630
I think we've already done some similar exercises that may come handy here.
27
00:02:42,290 --> 00:02:46,850
So take your time, try to think of the solution in once you're done.
28
00:02:47,150 --> 00:02:49,730
Let's proceed with our solution.
3044
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.