Find Minimum and Maximum Number in Array (Iterative and Recursive)

preview_player
Показать описание
In this video, I will show you how to find the minimum and the maximum number or element inside an array using a for loop and then using recursion.

What is recursion? Recursion is a function that calls upon itself. Here, we write a function that calls upon itself to find the min and the max value in a list using a for loop iteratively and then using recursion. While it is easy to use a for loop or while loop to do this, it is important that you understand these recursion steps to have a strong foundation to learn more complex recursive algorithm in the future.

LIKE & SUBSCRIBE:
Рекомендации по теме
Комментарии
Автор

Nice explanation.. I got a idea in it.. Thank you

IT-HARIPRASATHYS
Автор

Could you please explain why this gives False?

print(min(max(False, -3, -4), 2, 7))

liri
Автор

is there a way to do it in one function that takes in an array, its size, and the index #? for c++ specifically.

buyingsellingsf
Автор

Why is the the list represented as (L) on the first lint but represented as a 1 on the second and fourth line?

omerabdo
Автор

public static int FindMax(int[] arry, int max, int num)
{
if (arry.Length -1 < num)
{
return max;
}

if (arry[num] > max)
{
max = arry[num];
}

return FindMax(arry, max, num + 1);
}

I just used one recursion method

SayedAli-pjil