### The Summation Of Boundary Elements

Algorithm 2.8: Algorithm to find the summation of boundary elements

1. Input: A[1…m, 1…n], sum = 0;

//a two-dimensional array and a variable

2. Find each boundary element

for (i = 1; i ≤ m; i = i + 1)

for (j = 1; j ≤ n; j = j + 1)

if (i = 1 || j = 1 || i = m || j = n),

sum = sum + A[i, j];

[Boundary elements are those elements whose index i = 1 or j = 1, and those whose index i = m or j = n) and add it with sum (previous result)]

3. Output: Print sum as the result of summation of boundary elements

Back

Subscribe to:
Post Comments (Atom)

thank you

ReplyDeleteit was of gr8 help

very nice.....

ReplyDeleteThankz a lot bro...

ReplyDeleteThnks a lot

ReplyDelete