Monday 19 March 2018

Algorithm

An algorithm ( pronounced AL-go-rith-um) is a procedure or formula for solving a problem.A computer can be viewed as an elaborate algorithm.In mathematics and computer science, an algorithm usually means a small procedure that solves a recurrent problem.
    A formula or set of steps for solving a particular problem. To be an algorithm, a set of rules must be unambiguous and have a clear stopping point.Algorithm can be expressed in any language from natural languages like English or French programming language like FORTRAN.
   We use algorithm every day.For example, a recipe for baking a cake in an algorithm.

Advantage of Generalized Algorithm
  It is a foundational element of logic and human reasoning. Generalization points the existence of a domain or set of element, as well as one more common characteristics shared by those elements.
    In the case of certain enumerably infinite sets, we can give explicit instructions for determining the n th member of the set, for arbitrary finite n.Such instruction are to be given quite explicitly, in a form in which they could be followed by a computing machine.

Avoiding Infinite Loops in Algorithm-by Counting
   A loop is a sequence of statement which is specified once but which may be carried out several times in succession.The code "inside" the loop is executed a specified number of times, or once for each of a collections of items, or until some condition is met.
           An infinite loop is a sequence of instructions in a computer program which loops endlessly, either due to the loop having no terminating condition, having one that can never by met or once that causes the loop to start over.
         To be an algorithm, set of rules must be unambiguous and have a clear stopping point.
  A loop counter value can be used to tell how many times a statement or block of statement is to be execute.

Avoiding Infinite Loops in Algorithm-by using a Sentinel Value
   The following sentinel value are used:-
     The break Statement in Loops :
         A break statement can be used to end a loop immediately.
         A break statement ends only the innermost loop or switch statement that contains the break statement.break statement make loops more difficult to understand.
  The continue statement in Loops:
      A continue statement 
               It ends current loop iteration and Begins the next one.

0 Comments:

Post a Comment

Popular Posts

Categories

AI (27) Android (24) AngularJS (1) Assembly Language (2) aws (17) Azure (7) BI (10) book (4) Books (114) C (77) C# (12) C++ (82) Course (60) Coursera (176) coursewra (1) Cybersecurity (22) data management (11) Data Science (89) Data Strucures (6) Deep Learning (9) Django (6) Downloads (3) edx (2) Engineering (14) Excel (13) Factorial (1) Finance (5) flutter (1) FPL (17) Google (19) Hadoop (3) HTML&CSS (46) IBM (25) IoT (1) IS (25) Java (92) Leet Code (4) Machine Learning (44) Meta (18) MICHIGAN (5) microsoft (3) Pandas (3) PHP (20) Projects (29) Python (741) Python Coding Challenge (192) Questions (2) R (70) React (6) Scripting (1) security (3) Selenium Webdriver (2) Software (17) SQL (40) UX Research (1) web application (8)

Followers

Person climbing a staircase. Learn Data Science from Scratch: online program with 21 courses