官术网_书友最值得收藏!

What is an algorithm?

A logical set by step process, guided by the boundaries (or constraints) defined by a problem, followed to find a solution is called an algorithm. In a better and more pictorial form, it can be represented as follows:

What does that even mean? Look at the following example to understand the process.

Let's understand what an algorithm means with the help of an example.

It's your friend's birthday and you have been invited for the party (Isn't this exciting already?). You decide to gift her something. Since it's a gift, let's wrap it. What would you do to wrap the gift? How would you do it?

  • Look at the size of the gift
  • Fetch the gift wrapping paper
  • Fetch the scissors
  • Fetch the tape
  • Then you would proceed to place the gift inside the wrapping paper.
  • You will start start folding the corners in a way that it efficiently covers the Gift.
  • In the meanwhile, to make sure that your wrapping is tight, you would use a scotch tape.
  • You keep working on the wrapper till the whole gift is covered (and mind you, neatly! you don't want mommy scolding you, right?).

What did you just do? You used a logical step by step process to solve a simple task given to you.

Again coming back to the sentence: Logic + Control = Algorithm

Logic here, is the set of instructions given to a computer to solve the problem. 'Control' are the words making sure that the computer understands all your boundaries.

主站蜘蛛池模板: 封丘县| 安国市| 玉环县| 特克斯县| 金秀| 西和县| 馆陶县| 天镇县| 五河县| 金坛市| 方正县| 海淀区| 那曲县| 札达县| 桓台县| 准格尔旗| 新竹县| 宿州市| 富民县| 平谷区| 潜江市| 闵行区| 普宁市| 隆尧县| 防城港市| 景谷| 额济纳旗| 公安县| 赤壁市| 错那县| 共和县| 阿瓦提县| 虎林市| 乌兰浩特市| 涡阳县| 登封市| 黑水县| 巫山县| 长沙市| 安达市| 宣武区|