This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes General Computing and the fly likes Algorithm for match operatons in a Matrix Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "Algorithm for match operatons in a Matrix" Watch "Algorithm for match operatons in a Matrix" New topic

Algorithm for match operatons in a Matrix

Ali Rizvi

Joined: Jun 18, 2013
Posts: 1
Hi guys this is not quite a Programming question rather a logic question.

I have a matrix 5x5 like this :

a + b * c
* d + f +
g * h + i
+ j + k *
l + m * n

Can someone help me to find an algorithm to find all the math operations possible in this matrix?
Like :
a+d+f and so on.
I tried to make a Grapth data Structure but coud not find a solution.Can some one help to find this puzzle?
fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11150

1) Turn off your computer
2) Get some paper, pencils, and erasers
3) play around with how YOU would do it, using only the above materials.
4) Once you think you know how to do it, try to explain it to a 10 year old child in such a way that THEY could do it.

Only when you have completed the above should you consider turning on your computer and writing a single line of java.

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
subject: Algorithm for match operatons in a Matrix
Similar Threads
selecting one radio button from a matrix of radio button
The weirdest array index out of bounds error i have ever seen.
Trees in Java
Connection Array into an adjacency Matrix