Hello all and welcome back.
So in this video let us now continue our discussion on problem solving.
And now let's learn about the pseudocode.
Now pseudocode is something which you are going to hear a lot whenever you are trying to approach any
problem.
It is particularly useful when you are sitting in an interview, and you have to explain your interviewer,
your thought process, your overall way.
You are going to solve that particular problem which is given to you.
Now, a pseudocode is a simple way of describing an algorithm in plain language, or a mix of code like
and natural language instruction.
Okay, so it is very close to English where we are not saying that we are writing the code, we are
just trying to write how exactly our code is going to be.
It doesn't have to follow any syntax.
It can even have syntactical error or anything.
That is rather not something which I am aiming for as well.
My aim is that in simple, plain language, I am able to just tell what I am going to do.
It is not dependent on any language, so a pseudo code can be transformed into.
C c plus plus Java.
Python.
Anything, right?
Furthermore, it is not useful in places where you have mixed audience.
Right.
So you will see that in research papers normally pseudo code is written.
The reason for that is they don't expect that only programmers or coders are going to read their work.
Right.
So having this particular knowledge is very helpful.
Second thing, whenever you are doing documentation, whenever you are enlisting, that how you did
some particular work there?
Ideally we should be using pseudo code instead of the exact actual code which we have to which we have
written.
Okay.
The benefit again, anyone can be reading that particular piece of work which we have done.
So we want to make sure that it is understandable by everyone.
Now the next thing it doesn't follow any specific programming language syntax, making it easier to
understand even for those without programming knowledge, and the last pseudo code is often used as
a step before writing the actual code, something which I'm going to talk a little bit more in the next
video as well.
Okay, so great everyone.
Now let us try to write the pseudo code to find the sum of two numbers.
So let us see exactly how it's going to be.
To start with my pseudo code, I will just normally write begin and let me add multi-line comments.
So yeah.
So we are beginning everyone then what is happening?
I will say hey input a so that I mean to take the first number as input.
So I input first number maybe.
Okay, then I am saying input second number.
Now you will see one thing that in this lines which I have written, it is not dependent on any language.
Anyone can understand it and then try to write the code based on that.
Then I can say sum equals first, first number Plus second number.
Okay, then we can just print the sum again.
I don't care how we are going to print it.
Depending on language should be fine.
And I can finally say that it's end.
Okay, so the basic idea is there is no honestly no proper syntax or anything to follow.
That's the whole idea.
And I don't want all of you to write pseudo code for each and every problem as well.
I just want to make sure that any time you are solving a problem, you should have an idea that what
pseudo code will look like along with that major thing which is happening in that code.
You should try to write the pseudo code for that on a paper or a, uh, like any notepad which is in
front of you, because that is very helpful normally.
Okay.
So that's the basic idea behind pseudo code, everyone.
Now I will be giving you some questions for which you have to try and write the pseudo code yourself,
okay.
And you should be more than good to go in the next video.
We are now going to discuss the proper complete flow of solving any particular problem.