Algorithm:
Step1: START
Step2: Read n
Step3: for i=0 to
(n-1) do read xi,yi
Step4: read x
Step5: h←xi-x0
Step6: p←(x-xo)/n
Step7:
for j=0 to n-2 do ∆1yj←yj+1-∆i-1
Step8: k←n-2
Step9:
for i=2 to (n-1)do
Step9.1:
k←k-1
Step9.2:for
j=0 to k do ∆iyj←∆i-1 yj+1-∆i-1yj
Step10: Sumy←y0
Step11: Pvalue←1
Step12: Fact value←1
Step13: for l=1 to
(n-1) do
Step13.1: Pvalue←pvalue x (p-(l-1))
Step13.2: factvalue←factvaluex1
Step13.3: term←(pvalue x ∆ly) / factvalue
Step13.4: Sumy←Sumy+term
Step14: Print x,SUMY
Step15: STOP
Algorithm
No comments:
Post a Comment