Results 1 to 1 of 1
Thread: Commpress 2d array
- 07-03-2011, 04:34 AM #1
Member
- Join Date
- Jul 2011
- Posts
- 18
- Rep Power
- 0
Commpress 2d array
This method should return a new matrix with each of its dimensions halved in size. The way to do this is to “compress” the matrix by taking each 2 by 2 block of the original matrix, averaging the 4 values, and replacing it by the 1 average. You may assume that the matrix has even dimensions in both directions.
The header should look something like this:
public static int[][] halfSize(int[][] m)
Similar Threads
-
How to convert array of Objects into array of Strings
By elenora in forum Advanced JavaReplies: 1Last Post: 06-10-2011, 03:48 PM -
Display Array on another class after extracting from txt file and into array problem
By jonathan920 in forum NetBeansReplies: 0Last Post: 05-12-2011, 07:04 PM -
Variable of an object in an array compared to an element of another array?
By asmodean in forum New To JavaReplies: 23Last Post: 09-07-2010, 08:12 PM -
Trying to make an array list // inserting an element to middle of array
By javanew in forum New To JavaReplies: 2Last Post: 09-06-2010, 01:03 AM -
How to add an integer to a array element and the store that backinto an array.
By Hannguoi in forum New To JavaReplies: 1Last Post: 03-31-2009, 06:40 AM


LinkBack URL
About LinkBacks

Bookmarks