i gues..this will serve ur purpose
n = rows,m=columns ,arr[n][m] is matrix
for(int i=0;i=0 && j=0 && j wrote:
> for a N * M matrix is is possible to print zigzag fashion of that matrix?
> For example:
>
> 1 2 3 4 5
> 6 7 8 9 10
> 11 12 13 14 15
>
> i want print like
>
> 1
> 6 2
> 11 7 3
for a N * M matrix is is possible to print zigzag fashion of that matrix?
For example:
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
i want print like
1
6 2
11 7 3
12 8 4
13 9 5
14 10
15
I am able to get this where N !=M..
How can i do this, ??
--
You received this message because you are subs
This s nothing but a Topcoder problem based on Dynamic programming
link here
http://www.topcoder.com/tc?module=Static&d1=tournaments&d2=tccc03&d3=semiprob3
On Wed, Dec 15, 2010 at 6:56 PM, divya wrote:
> A sequence of numbers is called a zig-zag sequence if the differences
> between successive n
A sequence of numbers is called a zig-zag sequence if the differences
between successive numbers strictly alternate between positive and
negative. The first difference (if one exists) may be either positive
or negative. A sequence with fewer than two elements is trivially a
zig-zag sequence.
For e