155k views
5 votes
construct an indexing array indexarray so that the statement reversedorder = origorder(indexarray); results in a row array beginning at startingindex down to element 1.

User Garren S
by
8.5k points

1 Answer

4 votes

Final answer:

To construct an indexing array that results in a reversed order row array, follow these steps: create an empty array, initialize a variable, and add values to the array in reverse order.

Step-by-step explanation:

When constructing an indexing array indexarray that will result in a reversed order row array starting at startingindex down to element 1, you can use the following steps:

  1. Create the indexarray as an empty array.
  2. Initialize a variable i with the value of startingindex.
  3. While i is greater than 0, add the value of i to indexarray and decrement i by 1.

For example, if startingindex is 5, the resulting indexarray will be [5, 4, 3, 2, 1].

User Mark LeMoine
by
8.2k points