Write versions of the functions from exercise 5, but with a vector. Data from Exercise 5 Write

Question:

Write versions of the functions from exercise 5, but with a vector.


Data from Exercise 5

Write two functions that reverse the order of elements in a vector. For example, 1, 3, 5, 7, 9 becomes 9, 7, 5, 3, 1. The first reverse function should produce a new vector with the reversed sequence, leaving its original vector unchanged. The other reverse function should reverse the elements of its vector without using any other vectors (hint: swap).

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: