-
How can you traverse a matrix of m lines and n columns in a zig-zag way ?
Example : 1)m = 3,n = 2 a11 a12 a21 a22a31 a32Output : a11 a21 a12 a31 a22 a322) m = 3, n = 4a11 a12 a13 a14a21 a22 a23 a24a31 a32 a33 a34Output : a11 a21 a12 a31 a22 a13 a32 a23 a14 a33 a24 a34
-
Data Structure - character that repeats itself
Given a string of characters (let us say there are about 100 characters or more in the string), what is the most efficient method to use for finding out the character that repeats itself the most?Is it possible for us to use some kind of data structure for this?, if this is so,which is the best one that needs to be used?
-
function f(x) is continuous
The function f(x) is continuous in [0,1], such that f(0)=-1, f(1/2)=1 and f(1)=-1, We can conclude that 1. f attains the value zero at least twice in [0,1] 2. f attains the value zero exactly once in [0,1] 3. f is non-zero in [0,1] 4. f attains the value zero exactly twice in [0,1]