+ 7

Find max number in an array with Recursive algorithm

Can any one write an function that Find max number in an array with Recursive algorithm

26th Feb 2018, 1:02 PM
Yasin boloorchi
Yasin boloorchi - avatar
4 Respuestas
+ 16
https://code.sololearn.com/cguktJlM37R1/?ref=app its for 3 number , you can increase it whatever you want
6th Apr 2018, 12:41 PM
AliR૯za
AliR૯za - avatar
6th Apr 2018, 3:59 PM
Masoud Rabiee
Masoud Rabiee - avatar
+ 2
You can simply create a method with two parameters one is index and the other is the array, which of course, will start at the first 0, and then increases that index as you sum the values if the array, each time you call the same method with the the same array with the index incremented, the base case will be when your index becomes bigger than or equal to the length of the array, I didn't give the code because I think you should get the idea yourself and implemented it, best of luck.
7th Apr 2018, 12:11 AM
Abdulrahman Ali
Abdulrahman Ali - avatar
+ 1
thanks bro you realy helped me on this one
6th Apr 2018, 2:10 PM
Yasin boloorchi
Yasin boloorchi - avatar