Posts

Showing posts from October, 2016

Reverse a Nested List Recursively

Lab2.2 Reverse a Nested List Recursively You are expected to write a python program to reverse a list which may have nested lists within it. The number of nesting levels is not limited. As an example, the reversed list of [1, 2, [31, 32], 4, [51, [521, 522], 53], 6] will be [6, [53, [522, 521], 51], 4, [32, 31], 2, 1]

Find Maximum Number in a Nested List Recursively

Lab2.1 Find Maximum in a Nested List Recursively You are expected write a recursive python function to find the largest number within a given list. The list may contain numbers and strings and, you are expected to ignore the strings. In addition, the list may be a nested list with several nesting levels and you are expected to consider the numbers in all the nesting levels.