Friday, February 5, 2016

What is programming?

Let's know what is Programming...

Before we try to answer this question, let's discuss a scenario.. In a office, whenever the officer feels thirsty, asks the office-boy to give him a glass of water. The another scenario could be that , the officer has instructed the office-boy to keep ready a glass of water everyday on his table.

In the first scenario, the task is been done manually, where as in the second scenario the task is done automatically... which one is better ?

obviously... automatic...

So, from the example cited here, it is clear that, if you want to make some task or process take automatically, we need to develop a set on instructions and feed it.

Thus, developing a set instructions and then feeding it, to make the process automatic, is called programming.. If the instructions developed are fed to a computer machine, then it is called computer programming...

You can notice what is manual and automatic from following images...


Image result for coffee making in kitchen  images

Image result for coffee making in kitchen  images

Difference between height and depth of a tree

  • The depth of a node is the number of edges from the node to the tree's root node.
    A root node will have a depth of 0.
  • The height of a node is the number of edges on the longest path from the node to a leaf.
    A leaf node will have a height of 0.
A tree, with height and depth of each node