Algorithm
Algorithm-
An algorithm is a logical step-by-step method to solve a problem. Algorithm is a logic development tool. Algorithm includes calculation, data processing and reasoning processes. Three reasons for using algorithms are efficiency, abstraction and re-usability.
เคเค เค เคฒ्เคोเคฐिเคฅเคฎ เคिเคธी เคธเคฎเคธ्เคฏा เคो เคนเคฒ เคเคฐเคจे เคे เคฒिเค เคฒिเคे เคเค เค्เคฐเคฎเคฌเคฆ्เคง เคตाเค्เคฏों เคा เคธเคฎूเคน เคนोเคคी เคนै। เคฏเคน เคเค เคฒॉเคिเค เคกेเคตเคฒเคชเคฎेंเค เคूเคฒ เคนै เคिเคธเคฎे เคैเคฒเคुเคฒेเคถเคจ, เคกाเคा เคช्เคฐोเคธेเคธिंเค เคเคตं เคฐीเคเคจिंเค เคช्เคฐोเคธेเคธ เคो เคฐเคा เคाเคคा เคนै। เคเคธे เคช्เคฐเคฏुเค्เคค เคเคฐเคจे เคे เคคीเคจ เคฎเคนเคค्เคตเคชूเคฐ्เคฃ เคाเคฐเคฃ เคนै เคตिเคถ्เคตเคธเคจीเคฏเคคा, เคธाเคฐเคเคฐ्เคญिเคค เคเคตं เคชुเคจः เคเคชเคฏोเคीเคคा ।
เคเค เค เคฒ्เคोเคฐिเคฅเคฎ เคिเคธी เคธเคฎเคธ्เคฏा เคो เคนเคฒ เคเคฐเคจे เคे เคฒिเค เคฒिเคे เคเค เค्เคฐเคฎเคฌเคฆ्เคง เคตाเค्เคฏों เคा เคธเคฎूเคน เคนोเคคी เคนै। เคฏเคน เคเค เคฒॉเคिเค เคกेเคตเคฒเคชเคฎेंเค เคूเคฒ เคนै เคिเคธเคฎे เคैเคฒเคुเคฒेเคถเคจ, เคกाเคा เคช्เคฐोเคธेเคธिंเค เคเคตं เคฐीเคเคจिंเค เคช्เคฐोเคธेเคธ เคो เคฐเคा เคाเคคा เคนै। เคเคธे เคช्เคฐเคฏुเค्เคค เคเคฐเคจे เคे เคคीเคจ เคฎเคนเคค्เคตเคชूเคฐ्เคฃ เคाเคฐเคฃ เคนै เคตिเคถ्เคตเคธเคจीเคฏเคคा, เคธाเคฐเคเคฐ्เคญिเคค เคเคตं เคชुเคจः เคเคชเคฏोเคीเคคा ।
Characteristics of a good algorithm-
1.) An algorithm must contains a finite number of steps.
2.) Each step of an algorithm must be precisely defined.
3.) An algorithm should take zero or more inputs.
4.) An algorithm should give one or more outputs
5.) One or more statements should not be repeated infinitely.
6.) Order of statements must not be changed in algorithm.
7.) An Algorithm must finish after optimum time interval.
เคเค เค เค्เคी เค เคฒ्เคोเคฐिเคฅเคฎ เคी เคตिเคถेเคทเคคाเค-
1.) เคเค เค เคฒ्เคोเคฐिเคฅเคฎ เคฎें เคตाเค्เคฏों เคी เคธंเค्เคฏा เคชเคฐिเคฎिเคค(เคธीเคฎिเคค ) เคนोเคจी เคाเคนिเค ।
2.) เคช्เคฐเคค्เคฏेเค เคตाเค्เคฏ เคो เคชूเคฐ्เคฃเคค: เคชเคฐिเคญाเคทिเคค เคिเคฏा เคाเคจा เคाเคนिเค।
3.) เค เคฒ्เคोเคฐिเคฅเคฎ เคฆ्เคตाเคฐा เคถूเคจ्เคฏ เคฏा เค เคงिเค เคเคจเคชुเค เคฒिเค เคाเคจे เคाเคนिเค।
4.) เค เคฒ्เคोเคฐिเคฅเคฎ เคฆ्เคตाเคฐा เคเค เคฏा เค เคงिเค เคเคเคเคชुเค เคฆिเค เคाเคจे เคाเคนिเค।
5.) เคเค เคตाเค्เคฏ เคी เคชुเคจเคฐाเคตृเคค्เคคि เคจเคนीं เคนोเคจा เคाเคนिเค।
6.) เคตाเค्เคฏों เคे เค्เคฐเคฎ เคฎें เคชเคฐिเคตเคฐ्เคคเคจ เคจเคนीं เคिเคฏा เคाเคจा เคाเคนिเค।
7.) เค เคฒ्เคोเคฐिเคฅเคฎ เคเค เคจिเคถ्เคिเคค เคธเคฎเคฏाเคตเคงि เคे เคชเคถ्เคाเคค् เคธเคฎाเคช्เคค เคนो เค เคाเคจी เคाเคนिเค।
Example-
1.) An algorithm must contains a finite number of steps.
2.) Each step of an algorithm must be precisely defined.
3.) An algorithm should take zero or more inputs.
4.) An algorithm should give one or more outputs
5.) One or more statements should not be repeated infinitely.
6.) Order of statements must not be changed in algorithm.
7.) An Algorithm must finish after optimum time interval.
เคเค เค เค्เคी เค เคฒ्เคोเคฐिเคฅเคฎ เคी เคตिเคถेเคทเคคाเค-
1.) เคเค เค เคฒ्เคोเคฐिเคฅเคฎ เคฎें เคตाเค्เคฏों เคी เคธंเค्เคฏा เคชเคฐिเคฎिเคค(เคธीเคฎिเคค ) เคนोเคจी เคाเคนिเค ।
2.) เคช्เคฐเคค्เคฏेเค เคตाเค्เคฏ เคो เคชूเคฐ्เคฃเคค: เคชเคฐिเคญाเคทिเคค เคिเคฏा เคाเคจा เคाเคนिเค।
3.) เค เคฒ्เคोเคฐिเคฅเคฎ เคฆ्เคตाเคฐा เคถूเคจ्เคฏ เคฏा เค เคงिเค เคเคจเคชुเค เคฒिเค เคाเคจे เคाเคนिเค।
4.) เค เคฒ्เคोเคฐिเคฅเคฎ เคฆ्เคตाเคฐा เคเค เคฏा เค เคงिเค เคเคเคเคชुเค เคฆिเค เคाเคจे เคाเคนिเค।
5.) เคเค เคตाเค्เคฏ เคी เคชुเคจเคฐाเคตृเคค्เคคि เคจเคนीं เคนोเคจा เคाเคนिเค।
6.) เคตाเค्เคฏों เคे เค्เคฐเคฎ เคฎें เคชเคฐिเคตเคฐ्เคคเคจ เคจเคนीं เคिเคฏा เคाเคจा เคाเคนिเค।
7.) เค เคฒ्เคोเคฐिเคฅเคฎ เคเค เคจिเคถ्เคिเคค เคธเคฎเคฏाเคตเคงि เคे เคชเคถ्เคाเคค् เคธเคฎाเคช्เคค เคนो เค เคाเคจी เคाเคนिเค।
Example-
Algorithm for Simple Interest:-
1.) start
2.) take input principle (p), rate (r), time (t)
3.) calculate simple interest si=p*r*t/100
4.) print si
5.) stop
Algorithm for finding greatest among three numbers :-
1.) start
2.) take input principle (p), rate (r), time (t)
3.) calculate simple interest si=p*r*t/100
4.) print si
5.) stop
Algorithm for finding greatest among three numbers :-
1) start
2) Input a, b, c
3) is (a>b) No goto 7
4) is ( a>c) No goto 6
5) print a is greatest goto 10
6) print c is greatest goto 10
7) is (b>c) No goto 9
8) print b is greatest goto 10
9) print c is greatest
10) stop
2) Input a, b, c
3) is (a>b) No goto 7
4) is ( a>c) No goto 6
5) print a is greatest goto 10
6) print c is greatest goto 10
7) is (b>c) No goto 9
8) print b is greatest goto 10
9) print c is greatest
10) stop
Comments
Post a Comment