mardi 3 février 2015

what is the difference between algorithm and logic? [on hold]


I know that algo=logic+control. But if you were to differentiate logic and algo, how would one do it? can you give some simple real life analogies for the same?


Edited for clarity: I am trying to explain what an algorithm is to group of people who are not well acquainted with programming. Three terms that crop up in such discussions are: step-by-step instructions, logic and algorithm. All these three terms are interconnected yet distinct from each other.


For example, lets say I am searching for a photo in my photo album. I can say the step-by-step instructions would be: step 1: take a photo from the album step 2: check if it is the same photo as what you have in your mind step 3: if it is the same photo, stop searching further step 4: else, take the next photo and repeat the process


Now, this is a searching problem. So there are multitudes of searching algorithms. Now obviously Logic and Algorithm are not the same. Else we wouldn't need a new term 'algorithm' in the first place.


Now, can someone help me how I can carry the explanation of photo searching problem ( without modifying the steps further) to explain what is logic and what is algorithm.


Can a problem have many logic? When we say there are many algorithms to the same problem, what do we mean by it?





Aucun commentaire:

Enregistrer un commentaire