C++
Restrictions:
There should be no loops such as for loops, while loops, or
do-while loops, for each loop
used in this work. Instead, use recursion only.
Write a recursive function named Max that finds the maximum integer in an array of integers of size n by applying the following logic. ● Each call to the function breaks the array into two roughly equal halves, finds the maximum for each half, returns the greater of the two maximums You are allowed to use as many parameters as necessary for the Max function. Here's a diagram describing the idea {10, 20, 30} 7 {10,20} {30} {30} 2 {10} max 20 word 20 ✓ 30
C++ Restrictions: There should be no loops such as for loops, while loops, or do-while loops, for each loop used in this
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am