Reverse an array without using iteration

前端 未结 6 1694
走了就别回头了
走了就别回头了 2020-12-07 13:43

A question was asked to me today and I do not believe it is possible, but I could be wrong or am over thinking it. How can you reverse an array without using iteration in C?

6条回答
  •  北海茫月
    2020-12-07 14:31

    Implement a recursive function to reverse a sorted array. Ie, given the array [ 1, 2, 3, 4, 5] your procedure should return [5, 4, 3, 2, 1].

提交回复
热议问题