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/

29654717-387393.jpeg
29654717-387393.jpeg

The Type A question is: Given that the element is in the 3" row and 4" column, what is its
position in the linear sequence?
Answer:
seq_pos = (row_num - 1) x num_cols + col_num =
(3-1) x 5 + 4 = 14
So the element is the 14" in the linear sequence (which is obviously true.)
The Type B question is: Given that the element is in the 14" position in the linear sequence, what
are its row and column numbers in the array?
Answer:
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" row and 4" 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

Top Answer

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

Sign up to 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
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question