SHARE
TWEET

Untitled

snowden_web Jul 23rd, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #1
  2. def minRec(a, n = None):
  3.     if n == None:
  4.         n = len(a)
  5.     if n == 1:
  6.         return a[n-1]
  7.     elif n > 1 and a[n-1] < minRec(a,n-1):
  8.         return a[n-1]
  9.     a[n-2],a[n-1] = a[n-1],a[n-2]
  10.     return a[n-1]
  11.  
  12. b = [100,4,5,22,34,3,12,11]
  13. print(minRec(b))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top