WEBVTT

00:00.710 --> 00:02.300
Hello all and welcome back.

00:02.300 --> 00:05.780
So in this video let us now continue our discussion on problem solving.

00:05.780 --> 00:08.210
And now let's learn about the pseudocode.

00:08.300 --> 00:12.320
Now pseudocode is something which you are going to hear a lot whenever you are trying to approach any

00:12.320 --> 00:13.070
problem.

00:13.190 --> 00:18.890
It is particularly useful when you are sitting in an interview, and you have to explain your interviewer,

00:18.920 --> 00:21.980
your thought process, your overall way.

00:22.010 --> 00:26.000
You are going to solve that particular problem which is given to you.

00:26.180 --> 00:33.410
Now, a pseudocode is a simple way of describing an algorithm in plain language, or a mix of code like

00:33.410 --> 00:35.180
and natural language instruction.

00:35.210 --> 00:41.390
Okay, so it is very close to English where we are not saying that we are writing the code, we are

00:41.390 --> 00:45.200
just trying to write how exactly our code is going to be.

00:45.530 --> 00:47.900
It doesn't have to follow any syntax.

00:47.900 --> 00:50.690
It can even have syntactical error or anything.

00:50.690 --> 00:53.630
That is rather not something which I am aiming for as well.

00:53.690 --> 00:59.450
My aim is that in simple, plain language, I am able to just tell what I am going to do.

01:00.020 --> 01:04.900
It is not dependent on any language, so a pseudo code can be transformed into.

01:04.930 --> 01:06.700
C c plus plus Java.

01:06.700 --> 01:07.360
Python.

01:07.360 --> 01:08.800
Anything, right?

01:09.310 --> 01:14.140
Furthermore, it is not useful in places where you have mixed audience.

01:14.170 --> 01:14.710
Right.

01:14.710 --> 01:18.820
So you will see that in research papers normally pseudo code is written.

01:18.850 --> 01:24.820
The reason for that is they don't expect that only programmers or coders are going to read their work.

01:24.850 --> 01:25.390
Right.

01:25.390 --> 01:28.360
So having this particular knowledge is very helpful.

01:28.450 --> 01:34.090
Second thing, whenever you are doing documentation, whenever you are enlisting, that how you did

01:34.090 --> 01:36.220
some particular work there?

01:36.250 --> 01:42.400
Ideally we should be using pseudo code instead of the exact actual code which we have to which we have

01:42.400 --> 01:42.880
written.

01:42.910 --> 01:43.480
Okay.

01:43.510 --> 01:48.400
The benefit again, anyone can be reading that particular piece of work which we have done.

01:48.400 --> 01:52.180
So we want to make sure that it is understandable by everyone.

01:52.660 --> 01:57.340
Now the next thing it doesn't follow any specific programming language syntax, making it easier to

01:57.370 --> 02:02.730
understand even for those without programming knowledge, and the last pseudo code is often used as

02:02.730 --> 02:07.290
a step before writing the actual code, something which I'm going to talk a little bit more in the next

02:07.290 --> 02:08.370
video as well.

02:08.520 --> 02:09.690
Okay, so great everyone.

02:09.690 --> 02:13.890
Now let us try to write the pseudo code to find the sum of two numbers.

02:14.730 --> 02:17.070
So let us see exactly how it's going to be.

02:17.640 --> 02:23.430
To start with my pseudo code, I will just normally write begin and let me add multi-line comments.

02:23.430 --> 02:24.120
So yeah.

02:24.240 --> 02:27.930
So we are beginning everyone then what is happening?

02:28.020 --> 02:35.880
I will say hey input a so that I mean to take the first number as input.

02:35.910 --> 02:37.530
So I input first number maybe.

02:37.560 --> 02:42.450
Okay, then I am saying input second number.

02:42.630 --> 02:48.810
Now you will see one thing that in this lines which I have written, it is not dependent on any language.

02:48.840 --> 02:52.920
Anyone can understand it and then try to write the code based on that.

02:53.190 --> 03:03.860
Then I can say sum equals first, first number Plus second number.

03:04.370 --> 03:07.760
Okay, then we can just print the sum again.

03:07.760 --> 03:10.220
I don't care how we are going to print it.

03:10.250 --> 03:11.870
Depending on language should be fine.

03:11.960 --> 03:14.570
And I can finally say that it's end.

03:15.770 --> 03:21.650
Okay, so the basic idea is there is no honestly no proper syntax or anything to follow.

03:21.650 --> 03:22.670
That's the whole idea.

03:22.670 --> 03:27.170
And I don't want all of you to write pseudo code for each and every problem as well.

03:27.290 --> 03:31.640
I just want to make sure that any time you are solving a problem, you should have an idea that what

03:31.670 --> 03:36.980
pseudo code will look like along with that major thing which is happening in that code.

03:36.980 --> 03:42.440
You should try to write the pseudo code for that on a paper or a, uh, like any notepad which is in

03:42.440 --> 03:44.870
front of you, because that is very helpful normally.

03:44.900 --> 03:45.560
Okay.

03:45.560 --> 03:48.080
So that's the basic idea behind pseudo code, everyone.

03:48.080 --> 03:52.730
Now I will be giving you some questions for which you have to try and write the pseudo code yourself,

03:52.760 --> 03:53.060
okay.

03:53.090 --> 03:55.940
And you should be more than good to go in the next video.

03:55.970 --> 04:00.110
We are now going to discuss the proper complete flow of solving any particular problem.
