nagyuga
BAN USER- 0of 0 votes
Answerswrite a function to generate a random number in a given range.
- nagyuga in India
Condition:
Each number should be generated exactly n times, i.e., if each number has to be generated only 5 times and
the number 7 has already occured 5 times then your function should not generate 7 again.
Actual he asked question linking with array but it is bit confusion, he asked to do the above only| Report Duplicate | Flag | PURGE
Deshaw Inc Software Engineer / Developer Algorithm - 1of 1 vote
Answersfind longest increasing sub sequence in 2d array.
- nagyuga in United States
(bit more expl..)
ex: finding length of the snake in snake game
---------
the sequence must not be diagonally.
but it can be any like top-bootm,bottom-left-top ........
increasing means one step
ex: 10,11,12,13 (correct)
12,14,15,20(wrong)
Ex: input: consider 4x4 grid
2 3 4 5
4 5 10 11
20 6 9 12
6 7 8 40
output : 4 5 6 7 8 9 10 11 12| Report Duplicate | Flag | PURGE
Epic Systems Software Development Manager Algorithm
@alex , u misunderstand the Q ... like me, i will tell u complete Q
- nagyuga October 20, 2013write a function to generate random value for array index with satisfying given conditions.
condition:
1)Every index should be select "C" times
"C" is the value that is filled in array in all indexes.
Given
1) array with size "n" , having filled with constant value "c" in each index.
2) randomGenFromMToN() will give random number from m to n;