Click here to Skip to main content
15,892,927 members
Articles / All Topics

Matrix is Back... But This Time Instead of Action, It's for Fun..!!!!

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
19 Aug 2011CPOL2 min read 12.7K  
Matrix is back...

Welcome back, this article isn't a review on hollywood blockbuster si-fi "The Matrix", but this is all about fun with the basic math element Matrices. During your grade school, you might have played around with matrices, by applying basic operations, using different formulae, proving well defined theorems, etc.

But this time, we will keep all those things aside and take it to a different level wherein we explore different possible ways to read a matrix and try out some interesting tweaks. Let's stimulate all those lakhs of unused neurons in our brains for the first time (and this is a true fact) .

Here is the collection of few programming problems on matrices which I found on the web, in books and from friends. Try to solve these using minimum number of loops, use recursion and achieve the best, worst case running time. The problems are arranged on the basis of difficulty, moving from easier ones to difficult.

1) Given a M*N matrix of integers, convert all the integers in a row or column to zero, which already has a "Zero" in the input matrix.

2) Given a M*N matrix of integers, write a program to read the matrix in a circular way, starting from inside-out.

3) Given a M*N matrix of integers, write a program to read the matrix in a zig-zag way.

Note: This way of reading the matrix is used in Run Length Coding of JPEG image compression technique.

4) Given a M*N matrix of integers having both +ve and -ve numbers, write a program to find a sub-matrix with the maximum sum

5) Given a matrix from Sudoku puzzle, write a program to check whether the given matrix is a valid Sudoku puzzle or not by without solving the puzzle. Here, we assume that there could be invalid input matrices.

That's all for now! Sharpen your pencil, take a sheet of paper ... happy coding :-)

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Engineer
India India
I am Vijay hailing from Bangalore, the silicon valley of India. I posses extensive expertise working in mobility domain. I have a natural propensity for "Research and Innovation".

My areas of interest include Pervasive computing, Cognitive sensors, HCI, and Multimedia. Being strongly resolute with an everlasting fervor for learning, over the years I have learnt to come out of comfort zone to experiment with state of the art technologies and to contribute to developer community.

I blog about innovations and latest technologies from mobility domain, about development environments and programming languages across different platforms.

Blog : Amusement of a speculative mind...[^]
Projects : Amusement of a dilettante mind...[^]
LinkedIn : Vijay D R [^]

Comments and Discussions

 
-- There are no messages in this forum --