{"id":20410,"date":"2021-09-11T15:38:14","date_gmt":"2021-09-11T10:08:14","guid":{"rendered":"https:\/\/python-programs.com\/?p=20410"},"modified":"2021-11-22T18:36:21","modified_gmt":"2021-11-22T13:06:21","slug":"python-program-to-find-maximum-and-minimum-elements-in-list-array-using-recursion","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-find-maximum-and-minimum-elements-in-list-array-using-recursion\/","title":{"rendered":"Python Program to Find Maximum and Minimum Elements in List\/Array Using Recursion"},"content":{"rendered":"

In the previous article, we have discussed Python Program For Division Two Numbers Operator Without Using Division(\/) Operator<\/a><\/p>\n

Given a list and the task is to find the maximum and minimum elements in a given List using recursion in python<\/p>\n

Recursion:<\/strong><\/p>\n

Recursion is the process by which a function calls itself directly or indirectly, and the associated function is known as a recursive function. Certain issues can be addressed fairly easily using a recursive approach. Towers of Hanoi (TOH), Inorder \/Preorder\/Postorder Tree Traversals, DFS of Graph, and other analogous issues are examples.<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given List = [1, 6, 3, 7, 8, 4]<\/pre>\n

Output:<\/strong><\/p>\n

The Maximum element in a given list [1, 6, 3, 7, 8, 4] = 8\r\nThe Minimum element in a given list [1, 6, 3, 7, 8, 4] = 1<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given List = [20, 30, 40, 10, 50]<\/pre>\n

Output:<\/strong><\/p>\n

The Maximum element in a given list [20, 30, 40, 10, 50] = 50\r\nThe Minimum element in a given list [20, 30, 40, 10, 50] = 10<\/pre>\n

Program to Find Maximum and Minimum Elements in List\/Array Using Recursion in Python<\/h2>\n

Below are the ways to find the maximum and minimum elements in a given List using recursion in python:<\/p>\n