About 489,000 results
Open links in new tab
  1. Recursive Programs to find Minimum and Maximum elements of array

    Sep 19, 2023 · Given an array of integers arr, the task is to find the minimum and maximum element of that array using recursion. Examples : Output: min = -5, max = 8. Input: arr = {1, 4, …

  2. c - Find max in array with recursion - Stack Overflow

    Mar 20, 2015 · if(a[n-1]>m_max) m_max=a[n-1]; return m_max; // add } This linear approach gives recursion a bad name. If there are n numbers, the maximum recursive depth is n .

  3. Find Minimum and Maximum Elements of Array Using Recursion in C++

    Nov 3, 2021 · Learn how to find minimum and maximum elements of an array using recursive functions in C++. This guide provides step-by-step explanations and code examples.

  4. Find the Largest Element in an Array using Recursion in C

    Declare findMaxRec() function that takes the array and it’s length as arguments. Set base case as n==1, if true return the first element of the array A. else return the maximum value of the last …

  5. C++ Recursion: Maximum and minimum elements in an array

    Apr 14, 2025 · Write a C++ program to recursively find the maximum and minimum elements in an array by splitting the array into subarrays. Write a C++ program that implements a recursive …

  6. C recursive program to find the maximum element from array

    Jul 9, 2017 · You can change your code like this to have a recursive, stateless function that can determine the maximum value of the array. int find_maximum(int a[], int n) { return …

  7. c++ - Finding the largest value in array - Recursion - Code …

    Mar 5, 2022 · constexpr int find_max( const int array[], const size_t size ) /* Returns the maximum value of the array of the given size. * Throws std::logic_error if size is 0. */ { if ( size == 0 ) { …

  8. Largest Element of the array using Recursion in C++ | PrepInsta

    We will discuss both approaches to find largest element using recursion and iteratively. Create a recursive function say, largest_element (int n, int arr []). Base Condition : If (n==1) return arr …

  9. How to Find Maximum Value in Array in C++ | Delft Stack

    Feb 12, 2024 · Find Maximum Value in an Array in C++ Using the Recursive Approach. A recursive approach to finding the maximum value in an array provides an alternative method, …

  10. Program to find the minimum (or maximum) element of an array

    Apr 10, 2025 · Given an array, write functions to find the minimum and maximum elements in it. Examples: Input: arr[] = [1, 423, 6, 46, 34, 23, 13, 53, 4] Output: Minimum element of array: 1 …

Refresh