64.3k views
0 votes
What are the steps that are used to find the maximum element from the following finite sequence

1, 8, 12, 9, 11, 2, 14, 5, 10, 4.

User ElGauchooo
by
7.8k points

1 Answer

4 votes

Compare the first two elements, and whichever element is greater, then compare this greater element with the next element in the sequence and continue the comparison for the rest of the elements. The steps are as follow.

1<8

8<12

12>9

12>11

12>2

12<14

14>5

14>10

14>4

Hence 14 is the maximum element/number.

User Hossam Fathy
by
9.0k points