Let’s start off with pseudo codes. Pseudo codes are the informal tools that you use to design and plan out a program. As we start writing more and more complex programs, it becomes difficult to keep the entire program in mind before you code it.
Think of pseudo code as a step-by-step verbal outline of the code which you can later transcribe into any programming language. Pseudo codes are the combination of programming language and human language. These aim towards more readability for humans while it still has the hint of what the code will most probably look!
Usage of pseudo code in real life!!!!
Coders often use pseudo codes as an intermediate step between writing the actual code and initial planning stage. Good pseudo codes can become comments later in the source code as it becomes more readable (Good Programming Practices…..), and helps during debugging or going through the code later!!
Why so we need to write a pseudo code is the first place???
Pseudo codes help to build a frame work for any program.
Pseudo codes illustrates where a particular mechanism or algorithm, construct could or must appear in the source code.
Its implementation is very useful in structural design elements.
Converting a pseudo code to code is much more easy when compared with converting flowchart to code.
And ofcourse they are to write and read!!
Also remember there is no standard “syntax” that one should follow to write any pseudo code.
Pseudo code for designing a website….
You should also know what steps you need to write in your pseudo code. Take a look at the following pseudo code for eating a gum…..
1. Hold the gum pack in your hands 2. Unwrap the pack using fingers 3. Take the gum in fingers 4. Raise the hands and reach mouth 5. Put the gum in mouth 6. Chew the gum 7. Repeat step 6 8. if(bored OR taste vanishes) spit out; 9. Repeat steps 1 to 8
So now after reading this, do you think some steps are useless or some are missing??? Spare a thought for it….
Here are two examples for the pseudo codes go ahead and read the beauty….
This slideshow requires JavaScript.
Now let’s talk about algorithms.
Okay that’s not the actual definition for algorithm….. Algorithm is the sequence of steps taken to solve a program. The steps are “sequence”, “selection”, “iteration”, and case type statement.You can think of a programming algorithm as a recipe that describes the exact steps needed for the computer to solve a problem or reach a goal.
However, it’s important to note that a programming algorithm is not computer code. It’s written in simple English (or whatever the programmer speaks). It doesn’t beat around the bush–it has a start, a middle, and an end. In fact, you will probably label the first step ‘start’ and the last step ‘end.’ It includes only what you need to carry out the task. It does not include anything unclear, often called ambiguous in computer lingo, that someone reading it might wonder about.
Let’s talk about some advantages off algorithms..
They are easy to understand, as you can see from the above example.
They are not dependent on any particular programming language.
The algorithm sequence may also be displayed in the form of flow charts for clear understanding of the logic.
So now that we know about both pseudo codes and and algorithms, you must be wondering what is the difference between these two???
Pseudo-code is a means to express an algorithm.
It’s a somewhat fine distinction. Pseudo-code is to an algorithm as a painting of a tree is to an actual tree.
For those looking a deeper analysis:
An algorithm is a well defined sequence of steps that provides a solution for a given problem, while a pseudocode is one of the methods that can be used to represent an algorithm. While algorithms can be written in natural language, pseudocode is written in a format that is closely related to high level programming language structures. But pseudocode does not use specific programming language syntax and therefore could be understood by programmers who are familiar with different programming languages. Additionally, transforming an algorithm presented in pseudocode to programming code could be much easier than converting an algorithm written in natural language.
Talking about algorithms I recall a very good algorithm for friendship given by Dr. Sheldon Cooper, Ph.D (For those who don’t know, he is a character from the TV show The Big Bang Theory, he is not real!)
And the next you want to leave a room, here is a simple algorithm to follow…….
See you guys soon with new awesome topic….. And keep liking, commenting and following!
And also a new programming problem coming up!!!
Pseudo Codes And Algorithms…. Let's start off with pseudo codes. Pseudo codes are the informal tools that you use to design and plan out a program.