Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Matrix Program

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 10-12-2008
Member
 
Join Date: Oct 2008
Posts: 31
Matrix Program
  

I have a test of informatics tomorrow and I think it will drop those two programs involving matrix, but do not know them.
If anyone can help me now I'll be thankful!

The programs are,
  1. Show the sum of all the elements contained in the Matrix
  2. Show the highest number in the matrix pair

* Note: the arrays do not have a fixed number of row and column. The user of the program is one who will determine it.

Reply With Quote
  #2  
Old 10-12-2008
Member
 
Join Date: May 2008
Posts: 2,290
Re: Matrix Program

Well, you scroll through the entire array you'll have to go 2 bonds of repetition (for the first and second column for lines) aid within the innermost loop you make the operation of a variable sum (in order to accumulate the result).
Reply With Quote
  #3  
Old 10-12-2008
Member
 
Join Date: May 2008
Posts: 2,005
Re: Matrix Program

What Zecho said it should be like the program, but before you go looking for solutions, get ready to try the program yourself. It is not difficult.

It is not good to decorate this type of thing, you have to understand is what to do and implement the structures you know.
Reply With Quote
  #4  
Old 10-12-2008
Member
 
Join Date: May 2008
Posts: 2,290
Re: Matrix Program

@ Katty

I am still facing great difficulties in algorithms...this is pretty simple. If you do some simple examples it gives you a good understanding. But always took on algorithms bomb! Failed in the first year and spent "on the tin" in the second.

But it's always good to have the basics. Browse through the array, is supposed to make up with only 1 tie. Aid to lose but if I say grace (2 lessons led to us not find the answer and give teacher ...)


@ Zidaan

If you follow the advice of Katty it will be surely beneficial for you. You may require quite more practice. Mathematical algorithms are nearly identical, only need to learn the tricks by practicing.
Reply With Quote
  #5  
Old 10-12-2008
Member
 
Join Date: May 2008
Posts: 2,005
Re: Matrix Program

I was curious. I do not know that.
But suspect. This works in any language or only in C.
Reply With Quote
  #6  
Old 10-12-2008
Member
 
Join Date: Jan 2008
Posts: 1,514
Re: Matrix Program

In any language you can scroll through a matrix with a single case, it suffices to know the total quantity of items in the matrix.

And algorithms, in itself, an issue that many resent, but that the gang is not humble.

I had a professor of physics who use to say that the important thing is be humble. And this teacher taught a technique for solving problems of physics that I most looking forward & applied in all other areas and believe that can be used in any situation.

Come on:
1 - what's the problem?
A: In that case the problem was to show the sum of all items included in the matrix.

2 - I know the theory?
A: I know that matrix is used to scroll through 2 bonds of repetition, I know that a variable can be added using the operator + =.

3 - How can I use the theory to solve the problem?
A: If a parent can be run using two strings of repetition I can get a variable and for each item of the matrix I can add in the form of variable + = array [i] [j].

Thus it is possible resolve any problem in 3 easy questions. People who have difficulties with algorithms and can not solve the problem or using these forms, that is a problem in some of the items, or unable to interpret the issue, or does not have enough theory to solve the problem (and therefore worthy of reproach years) or do not have enough experience to know how to apply the theory to solve the problem. This experience can be acquired only with practice. Passing a whole year in classroom and not practiced during the entire time in the race also deserves to have another year of practices
Reply With Quote
  #7  
Old 10-12-2008
Member
 
Join Date: May 2008
Posts: 2,005
Re: Matrix Program

Quote:
Originally Posted by Modifier View Post
In any language you can scroll through a matrix with a single case, it suffices to know the total quantity of items in the matrix.
I do not know if this is true, I am almost sure that some language criticizing it.

In Pascal, for example, it displays an error message of "Array Index out of bounds" or some "overflow" (or something, do not remember for sure), so I asked if it was in C.

I will kill the curiosity of the people.

In a 2x2 matrix:

1 2
3 4

Although the figures are in different "lines", in memory they are in following positions:

1 2 3 4

Thus knowing the total quantity of items you can read them all.
Reply With Quote
  #8  
Old 10-12-2008
Member
 
Join Date: May 2008
Posts: 2,290
Re: Matrix Program

It really is possible in any programming language.

I had the algorithm here, but I will make a search. I recall that has to do with using "mod" in both indices of the array.

For example, if the matrix is 3x3 the sequence would look like this:

00
01
02
10
11
12
20
21
22

But remember not to head the algorithm...you speak the truth or tried, but as this is the teacher who taught...
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Matrix Program"
Thread Thread Starter Forum Replies Last Post
New Matrix Movie (Matrix ReEntered) Vicious Off Topic Chat 8 08-02-2011 07:24 PM
Any fastest way to compute 3x3 Matrix inverse and Matrix multiplication? Logan.B Software Development 4 25-09-2010 05:11 PM
Program to explain the multiplication of the two matrix Roxy_jacob Software Development 4 01-12-2009 11:21 AM
When do we use Matrix class in java Neil'o Software Development 3 26-06-2009 02:27 PM
Problem recovery matrix in C Rilex Software Development 3 07-05-2009 11:53 PM


All times are GMT +5.5. The time now is 03:11 AM.