Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 2: Write a function with the following signature def matrixTranspose(L): Specification: L is a nested list representation of an mn matrix M. The function
Problem 2: Write a function with the following signature def matrixTranspose(L): Specification: L is a nested list representation of an mn matrix M. The function is required to return the nested list representation of the transpose of M, denoted MT, which is an nm matrix. For example, if M=[32104511] then MT=31052411. Therefore, if L=[[3,10,5],[2,4,11]] then the function should return the list [[3,2],[10,4],[5,11]]. Examples - matrixTranspose([[3, 10, 5], [2,4,11]]) should return [[3,2],[10,4],[5,11]] - matrixTranspose([[2], [5], [7]]) should return [[2,5,7]] - matrixTranspose([[2, 3], [5, 7], [7, 9], [9, 11]]) should return [[2,5,7,9],[3,7,9,11]] - matrixTranspose([[1, 1, 1, 1]]) should return [[1], [1], [1], [1]]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started