[algogeeks] Allocation problem

2009-06-18 Thread Manish Garg
Hi, This is an allocation problem, where rules for allocation is given in ratio. These ratios are maintained in a 2-d matrix. While creating the ratios we do not have any restriction. So there is possibility of circular allocation, but infinite loop won't be there. Following is the example: A is

[algogeeks] Re: Array of integers

2007-11-19 Thread Manish Garg
can find in O(n) if array is sorted On Nov 18, 2007 9:13 AM, dor [EMAIL PROTECTED] wrote: You can do it in O(n log(n)) (without extra space). If you can afford O(T) extra space (where T is the largest number in the array, in absolute value), you can do it in O(n). On Nov 17, 3:42 pm,

[algogeeks] Re: Longest Common Sequence

2007-08-11 Thread Manish Garg
actually problem is not clear... is this ur problem thatur regular expression contains the list of 300 zip codes and u want to search that on any string...that if any zip code is present it will report...and u want us to give suggestion to make this regular expression shorter is this

[algogeeks] Re: selecting data region, 2d, multi-d

2007-08-11 Thread Manish Garg
Selecting a rectangle is O(log N * M) where M is the number of datapoints in the 'band'. Anyone know of anything better? i think u can come up with an proof that we can make any algorithm that has complexity less then O(log N * M)...if u have all point array sorted... one more thing...that

[algogeeks] Re: Implementation of Dijkstra and other shortest path problems.

2007-08-10 Thread Manish Garg
ok...thanx for correcting... On 8/10/07, Muntasir Azam Khan [EMAIL PROTECTED] wrote: On Aug 10, 9:41 pm, Manish Garg [EMAIL PROTECTED] wrote: in Java...whatever data structure u want...there is a seperate library for that... it also provides the inbuilt function to access

[algogeeks] Re: Implementation of Dijkstra and other shortest path problems.

2007-08-10 Thread Manish Garg
in Java...whatever data structure u want...there is a seperate library for that... it also provides the inbuilt function to access and manipulate the data structure... like for tree there is jtree for proirity queue there is one like proirity queue for knowing this u better use javadoc its

[algogeeks] Re: Removing a set of characters from a given string

2007-08-08 Thread Manish Garg
i think there is only one and srtaight forwad way to do this... i m writing C code for that.if any one can do it with less complexityplz reply.. int flag; do{ flag=0; for(int i =0;subject[i] !='\0';i++) {

[algogeeks] The Game

2007-02-21 Thread Manish Garg
hi, I m posting a game, its like this: Suppose N people are playing the game. All of them are numbered from 1 to N. They all sit in a circle such that their numbering order is also maintained, so that the last person (numbered N) sits adjacent to the first person (numbered 1). Now an integer K

[algogeeks] fibonacci numbers

2007-01-20 Thread Manish Garg
hi, i have one algo problem... what can be the fastest way to find the two fibonacci numbers around x. say x is given to u then we have to find the two fibonacci numbers one is less then or equal to x and other one is greater then x. for exmple x =5 then output is 5 and 8. -- Manish Kumar

[algogeeks] Re: Problem

2006-11-07 Thread Manish Garg
it will be better if u will give at least one sample input and output. On 11/7/06, mohamad momenian [EMAIL PROTECTED] wrote: Hi i have a problem please help me The input of problem is : width and height of 4 rectangle that is between 1,50 and thewe mustcalculate widthand height ofallof