View the step-by-step solution to:

Question

This question was created from ENS1161_A1_ECU_v25_1_2018.docx https://www.coursehero.com/file/29654717/ENS1161-A1-ECU-v25-1-2018docx/

The Type A question is: Given that the element is in the 3&quot; row and 4&quot; column, what is its
position in the linear sequence?
seq_pos = (row_num - 1) x num_cols + col_num =
(3-1) x 5 + 4 = 14
So the element is the 14&quot; in the linear sequence (which is obviously true.)
The Type B question is: Given that the element is in the 14&quot; position in the linear sequence, what
are its row and column numbers in the array?
row_num = CLG(seq_pos / num_cols)
1 CLG( 14 / 5 ) = CLG(2.8) = 3
col_num = MOD(seq_pos - 1, num_cols) + 1
(b) MOD(14-1, 5) + 1 = MOD(13, 5) + 1 = 3+1 =4
So the element is in the 3&quot; row and 4&quot; column.
Practice examples:
Fill in the blanks in the table
Number of
Row
Column
Sequence
columns in array
number
number
position
(i)
8
5
3
ii
12
6
2
(iii)
15
50
(iv)
30
200

Here's the explanation you needed for... View the full answer

### Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

• ### -

Study Documents

Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

Browse Documents