Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

language:pyton Help me soon please Longest sequence Given a matrix Mot dimension MXN design an algorithm and write the Python code to generate a sequences

language:pyton
Help me soon please image text in transcribed
image text in transcribed
Longest sequence Given a matrix Mot dimension MXN design an algorithm and write the Python code to generate a sequences where M, Bach that: Thero exist on-1) potitions ....) in M1 Entries in positions...)) of Mare same For example, 4 X 4 matrix is given as below: 7 90 271 9208 3371 Elements of the matrix occur in the following positions t occurs in the positions: 10, 1), (1,31.13,3) 2 occurs in the positions: (2.1), (1, 0) 3 occurs in the position: (3.0) 7 occurs in the positions:(0.01.11 (32) occurs in the positions (2.11. (10) 3 occurs in the position: (0 7 occurs in the positions (0,0). 11. (3,2) Boccurs in the position: (0,313, 1.61.21.2,3) 9 occurs in the positions 12.2.2. OX (0, 2) The longest possible sequence is tor element and it is 0.3-1-2 Wren more than ont element has a longest sequence, print at elements and their longest sequence, sorted by the clement. When an element has more than one longest sequence, sort the sequencel and consider only the first and discard the rest Input Format Number of rows of the matrix Number of columns of the matrix Elements of row Elements of row2 Output Format Element with longest soquence in matrix and the longest sequence separated by a tab. When there are more than one element with longest sequence, print in sorted order by element

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Refactoring Databases Evolutionary Database Design

Authors: Scott Ambler, Pramod Sadalage

1st Edition

0321774515, 978-0321774514

More Books

Students also viewed these Databases questions