• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Lecture913
 

Lecture913

on

  • 301 views

 

Statistics

Views

Total Views
301
Views on SlideShare
301
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Lecture913 Lecture913 Presentation Transcript

    • Ìýäýýëëèéí ñèñòåì, àëãîðèòìèéí ¿íäýñ Ëåêö ¹13
    • Àãóóëãà 1. Äýä àëãîðèòì 2.Äýä àëãîðèòì áè÷èõ 3.Äýä àëãîðèòì äóóäàõ áà ò¿¿íýýñ áóöàõ 4.Àðãóìåíò 5.Õèéñâýð àðãóìåíò 6.Äýä àëãîðèòìûã õýðýãëýõ
    • Äýä àëãîðèòì Áèå äààñàí øèíæòýé, òîäîðõîé ¿ð ä¿í ºãäºã þìóó ýñâýë òîäîðõîé(çóðàõ, áè÷èõ, ôàéë íýýõ ã.ì) ¿éëäýë ã¿éöýòãýäýã àëãîðèòìûã òóñàä íü áè÷èæ, îëîí äàõèí àøèãëàõ áîëîìæèéã õàíãààä äýä àëãîðèòì ãýæ íýðëýíý.
    • Äýä àëãîðèòì àøèãëàæ áàéãàà àëãîðèòìûã ýõ àëãîðèòì ãýíý. Àëèâàà äýä àëãîðèòì íü àëãîðèòìûí á¿õ øèíæèéã õàíãàñàí áàéíà.
    • Äýä àëãîðèòì áè÷èõ Òîäîðõîé äýä àëãîðèòìûã ¿íäñýí áîëîí áóñàä äýä àëãîðèòìààñ ÿëãàõûí òóëä ò¿¿íèéã íýðëýýä äýä_àëã ò¿ëõ¿¿ð ¿ãýýð ýõýëñýí, àëãîðèòìûí òºãñãºëèéã çààñàí
    • áóö ãýñýí ò¿ëõ¿¿ð ¿ãýýð òºãññºí áàéõ äîîðõ åðºíõèé õýëáýðòýé áè÷íý. äýä_àëã íýð áèå_¿éëäë¿¿ä áóö;
    • Äýä àëãîðèòì äóóäàõ áà ò¿¿íýýñ áóöàõ ßìàð íýã àëãîðèòì äîòîð òîäîðõîé äýä àëãîðèòìûã àøèãëàõ, º.õ óã äýä àëãîðèòìûã áèåë¿¿ëæ ¿ð ä¿íã àâàõ áóþó ýñâýë óã äýä àëãîðèòìûí ã¿éöýòãýäýã ¿éëäëèéã õèéëãýõèéí òóëä øààðäëàãàòàé áàéðàíä ò¿¿íèé íýðýýð õàíääàã.
    • ¯¿íèéã äýä àëãîðèòìûã äóóäàõ ¿éëäýë ãýæ íýðëýäýã. Äýä àëãîðèòìûí ¿éëäë¿¿ä áèåëæ ¿ð ä¿í áýëýí áîëîõîä óäèðäëàãûã ýõ àëãîðèòìä áóö ãýñýí ò¿ëõ¿¿ð ¿ã àøèãëàí áóöààõ ¸ñòîé.
    • Äýä àëãîðèòìûí àðãóìåíò ¿ð ä¿íã äàìæóóëàõ Äýä àëãîðèòìä øààðäàãäàõ àíõíû óòãûã äýä àëãîðèòìûí àðãóìåíò ãýæ íýðëýõ áà õàðèí äýä àëãîðèòìààñ ¿íäñýí àëãîðèòìä áóöààõ óòãûã äýä àëãîðèòìûí ¿ð ä¿í ãýíý.
    • ¯íäñýí àëãîðèòì áîëîí ò¿¿íèé äýä àëãîðèòìóóäàä á¿ãäýä íü õýðýãëýæ áîëîõîîð òîäîðõîéëñîí õóâüñàã÷èéã ãëîáàëü õóâüñàã÷ ãýæ íýðëýíý. Äýä àëãîðèòì äîòîð òîäîðõîéëîãäñîí áºãººä çºâõºí òýíä õýðýãëýãäýõ õýìæèãäýõ¿¿íèéã ëîêàëü õóâüñàã÷ ãýæ ïðîãðàì÷ëàëä íýðëýäýã.
    • Äýä àëãîðèòìûí åðºíõèé õýëáýð Èéíõ¿¿ äýä àëãîðèòìûã äýä_àë ã íýð (òºðºë_1,ïàðàìåòð_1,…,òºðºë_n, ïàðàìåòð_n) áèå_¿éëäë¿¿ä áóö;
    • ãýñýí åðºíõèé õýëáýðòýé áè÷èæ áîëîõ áà ò¿¿íèéã äóóäàõ ¿éëäýë íýð (æ_ïàðàìåòð_1,…,æ_ïàðàìåòð_n); õýëáýðòýé áàéíà.
    • Õèéñâýð àðãóìåíò Äýä àëãîðèòìûã òîäîðõîéëæ áè÷èõ ¿åä äýä_àëã íýð (òºðºë_1, ïàðàìåòð_1, …,òºðºë_n, ïàðàìåòð_n) èëýðõèéëýëä ïàðàìåòð_1,…,ïàðàìåòð_n íü õóâüñàã÷èéí íýð áàéõ áºãººä àðãóìåíòûí
    • æèíõýíý óòãûã ºãºõã¿é, õàðèí çºâõºí ÿìàð òºðëèéí, õýäýí àðãóìåíòòýé àëãîðèòì áîëîõûã ë çààõ ¿¿ðýãòýé. Èéìä äýä àëãîðèòìûí òîëãîéä áè÷èæ áàéãàà õóâüñàã÷èéã õèéñâýð àðãóìåíò ãýæ íýðëýíý.
    • Äýä àëãîðèòìûã äóóäàõ (æ_ïàðàìåòð_1,…,æ_ïàðàìåòð_n);èëýðõèéëýëä áàéãàà æ_ïàðàìåòð_1,…,æ_ïàðàìåòð_n íü àëãîðèòì áèåëýõ ¿åä õàðãàëçàí ïàðàìåòð_1,…,ïàðàìåòð_n õóâüñàã÷èéí æèíõýíý óòãà áîëæ àøèãëàãäàõ ó÷ðààñ æèíõýí àðãóìåíò ãýæ ïðîãðàì÷ëàëä íýðëýíý.
    • Äýä àëãîðèòìûã äóóäàõ ¿éëäýë áèåëæ äýä àëãîðèòìä óäèðäëàãà î÷èõ ¿åä {ïàðàìåòð_1:=æ_ïàðàìåòð_1;…;ïàðàìåòð_n:=æ_ïàðàìåòð_n};ãýñýí ¿éëäýë àâòîìàòààð õèéãääýã.
    • Æ èøýý: áîäèò a,b,c,t,x,y,xy max; îðóóë(a,b,c); x:=a; y:=b+c; xymax:=x; õýðýâ y>xymax áîë xymax:=y; t:=xymax; y:=a+c; xymax:=x; õýðýâ y>xymax áîë xymax:=y; t:=t+xymax; x;=a+b*c; y:=3.1415; xymax:=x; õýðýâ y>xymax áîë xymax:=y; t:=t(1+xymax); ãàðãà(t) òºãñ
    • Æèøýý-èéã äýä àëãîðèòì àøèãëàí áè÷âýë:
      • Æèø 1
      • áîäèò a,b,c,t,x,y,xymax;
      • îðóóë(a,b,c);
      • x:=a;
      • y:=b+c;
      • xymax;
      • t:=xymax;
      • y:=a+c;
      • xymax;
      • t:=t+xymax;
      x:=a+b*c; y:=3.1415; xymax; t:=t(1+xymax); ãàðãà(t) òºãñ Äýä_àëã xymax xymax:=x; Õýðýâ y>xymax áîë xymax:=y Áóö;
    • Äýä àëãîðèòìûã õýðýãëýõ Ïðîãàðì÷ëàëä ºãºãäºë ìýäýýëýë îðóóëàõ,ìýäýýëëèéã ãàðãàæ õýâëýõ,ôàéë íýýõ,ôàéë õààõ ãýõ ìýò òîäîðõîé ¿éëäýë (àæèë) ã¿éöýòãýäýã äýä ïðîãðàì (àëãîðèòìûã) àøèãëàäàã.
    • Èéì òºðëèéí äýä àëãîðèòìààñ ãàäíà òîäîðõîé íýã óòãà áîäîæ ºãäºã äýä àëãîðèòì (ïðîãðàì) ìàø ò¿ãýýìýë õýðýãëýäýã.