[algogeeks] Re: Interger Encryption

2006-11-10 Thread L7
Do you mean a 'mapping'? i.e. 1 --> 4 2 --> 3 3 --> 2 4 --> 1 Where --> means 'maps to'. Or do you want to arrange the bits so that there is always a different result after the operation? i.e. 1 --> [0..0x] 2 --> [0..0x] ... Any ouput is valid given an integer input. --~--~-~-

[algogeeks] Re: How to select top 100 from one million numbers.

2006-11-10 Thread Arun
I think 1) is good choice. for 3) its not O(lgn) it would be O(n) if u force the pivot to be n-100.Selection algorithm also wud work here (O(n)).if u know the range of numbers, u can use a bitmap(courtesy : programming pearls). Though its O(n), if the range is small, u neednot examine the full list

[algogeeks] Re: Minimal path sum in a matrix (optimizing the algorithm)

2006-11-10 Thread Karthik Krishnamurthy
Hi, Sorry for the small typo error... Its not max, its min. From above, a recurrent relation can be easily obtained:>> For the first row, simply calculate S[i][j]=S[i][j]+S[i][j-1]; >> For the first col, simply calculate S[i][j] =S[i][j]+S[i-1][j]; >> For the rest of the matrix, calculate S[i][j] =

[algogeeks] Re: Minimal path sum in a matrix (optimizing the algorithm)

2006-11-10 Thread Karthik Krishnamurthy
Hi,I think DP(Dynamic Programming) will help you better than memoization because in the case of DP there isn't any recursive calls. As for as your problem is concerned, DP will run in O(n^2). The solution is pretty simple. The first thing that must be observed is that there are at most 2 ways we c

[algogeeks] Interger Encryption

2006-11-10 Thread howa
If I want to encrypt an interger (4 bytes) to another interger , e.g. which algorithm is well known for performance & security? thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To

[algogeeks] Can't undrestand problem statement !!

2006-11-10 Thread Shayan Ehsani
Dear geeks.   I saw a problem in sgu online judge but i could not exactly undrestand what it meant! I would be so thankfull if you clarifing the problem statement. Here is the link of problem http://acm.sgu.ru/problem.php?contest=0&problem=191.   Yours faithfully. Shayan --~--~-~--~~--

[algogeeks] Re: Least Lost Selection Problem

2006-11-10 Thread arun kumar manickan
my idea,   say, fruit1 is required to make person A and person B happy.   person A requires num1 number of fruit1 and person B requires num2 number of fruit1.   then required number of fruit1 is max( num1 , num2 )   similary if you can extend this to all who require it and calculate the max require

[algogeeks] Least Lost Selection Problem

2006-11-10 Thread xiaohuamao
Hi, all. There a number of boys that require to see some fruits. ( Just required to see them not to eat them,that means an apple may make many boys happy).Each boy may requires to see different number and different kinds of fruits. For example, Allen requires two apples or a banana.Billy requires