Question: Task 1: Recursive Problem Solving Part A: Euclid's Algorithm Re-implement Euclid's algorithm using a recursive functiongcd(a, b). Part B: List Inversion Write a recursive functionreverse(lst)that

Task 1: Recursive Problem Solving

Part A: Euclid's Algorithm

Re-implement Euclid's algorithm using a recursive functiongcd(a, b).

Part B: List Inversion

Write a recursive functionreverse(lst)that computes the reversion oflst. For example:

>>> reverse([1, 2, 3, 4])

[4, 3, 2, 1]

>>> reverse([10, 11, 12, 13, 14]) [14, 13, 12, 11, 10]

  • >>>reverse ([1]) [1]
  • >>>reverse ([]) []

Part C: Palindromes

Write a recursive functionis pal(string)to check if a string is palindrome. A palindrome string is a string that reads the same form either direction. For example:

>>> is_pal('aa') True

>>> is_pal('aabb') False

>>> is_pal('aba') True

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!