subarray_problem
>Don
>
>On Thursday, August 29, 2013 11:09:59 PM UTC-4, yash wrote:
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To unsubscribe from this group and stop r
This search can be done easily in O(n+m) start from top right corner. chek
out this link you will understand!!
http://www.geeksforgeeks.org/archives/11337
On Sunday, 1 April 2012 21:18:26 UTC+5:30, ashgoel wrote:
>
>
--
You received this message because you are subscribed to the Google Groups
http://www.cut-the-knot.org/wgraph.shtml
Every distribution of wine in the three jugs A, B, and C, can be described
by the quantities b and c of wine in the jugs B and C, respectively. Thus
every possible distribution of wine is described by a pair(b, c). Initially
b=c=0 so that one starts wi
answer should be 3/5
think like that tossing 5 times will not help you predict the outcome
of sixth toss. Therefore that information is meaningless.
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeek
Hi,
Here is my solution, let me know:
/* a helper function */
void swap(int* arr, int index1, int index2) {
/* this is only to swap to integers */
arr[index1] = arr[index1]^arr[index2];
arr[index2] = arr[index1]^arr[index2];
arr[index1] = arr[index1]^arr[index2];
}
/* Actual switching */
void s
each pair of opposite faces can make 4 such triangles, so I think the answer
is 12
On Mon, Feb 28, 2011 at 5:47 AM, sourabh jakhar wrote:
> the answer would be more than 8 an it is 32 i think.
> but i m sure it will be more than 8
>
>
> On Wed, Feb 23, 2011 at 7:54 AM, Terence wrote:
>
>> 8C3 -
I forgot to mention
Time complexity: O(n), Space complexity: O(1)
Assuming you accept my solution :-)
On Mon, Feb 28, 2011 at 9:27 PM, Vinay Pandey wrote:
> Hi,
>
> Here is my solution, let me know:
>
>
> /* a helper function */
> void swap(int* arr, int index1, int index2
cases of this algo is N*N , if we try balancing the tree while
inserting I guess it can be done in NlogN
Thanks
Vinay
On Fri, Feb 25, 2011 at 9:20 AM, Gene wrote:
> Dave's solution is best if numerical error is possible.
>
> If the points are precise, you can also do it in line
U need to construct a binary tree given only PreOrder traversal with the
condition that each node has zero or two children.
On Wed, Feb 23, 2011 at 10:52 AM, murthy.krishn...@gmail.com <
murthy.krishn...@gmail.com> wrote:
> hii vinay,
>
> can u elaborate the third question
>
&
, where every node has zero or
two children.
e.g String = "NNNLLL" , N represents internal Node , L represents leaf
Node.
The alloted time was 1hr. and asked to write the function only ... no main
function and all.
hope this helps
Thanks
vinay
On Wed, Feb 16, 2011 at 3:45 PM, Anu
can u plz elaborate how min heap helps to find most repeating words
On Oct 21, 6:40 am, ashish agarwal
wrote:
> use a array of 10 and apply min heap
>
>
>
> On Thu, Oct 21, 2010 at 7:05 PM, Vinay... wrote:
> > how do u find 10 most repeating words on a large file contain
how do u find 10 most repeating words on a large file containing words
in most efficient way...if it can also be done using heapsort plz post
ur answers..
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to al
I think by defining equivalnces also we can print miracle
for ex -1%2 and 1%2 are same and 1%2!=0 odd%2 and -odd%2 are same and odd!=0
but -1%2 is giving -1 .
but don't know how to make it 1.
help someone if possible.
On Mon, Aug 30, 2010 at 12:40 AM, srinivas reddy
wrote:
> @aravind thanks y
which tree?
On Tue, Feb 10, 2009 at 7:01 AM, praba garan wrote:
> how to find the successor of an element in a tree ??
>
> thank u
>
> >
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To
[1,12,-3,14,-6,3,4,-2]
Check if your approach works here. Apparently not. A subset of an array
should also be continuous, by definition.
On 10/15/07, Muntasir Azam Khan <[EMAIL PROTECTED]> wrote:
>
>
>
>
> On Oct 13, 11:39 pm, kannan <[EMAIL PROTECTED]> wrote:
> > hellow!
> > here is the
in the previous logic, dont forget to address a negative divisor, dividend
and alternative cases like those... it shud be pretty easy
On 10/8/07, Vinay Chilakamarri <[EMAIL PROTECTED]> wrote:
>
> hey there i did play around with bit shifting sometime ago and was able to
> do th
or in the above logic.. Ill post the bit shifting
algo soon
~_
On 10/7/07, Ajinkya Kale <[EMAIL PROTECTED]> wrote:
>
> @Vinay : Can you please explain the algorithm of your code..
>
> On 10/7/07, Vinay Chilakamarri < [EMAIL PROTECTED]> wrote:
> >
> > How about rec
Sorry but lets start with a quotient of 1
On 10/7/07, Vinay Chilakamarri <[EMAIL PROTECTED]> wrote:
>
> How about recursive way:
>
> int funcNoDiv(int divisor, int dividend)
> {
> //base case
> if(divisor == dividend)
> {
> return 1;
>
How about recursive way:
int funcNoDiv(int divisor, int dividend)
{
//base case
if(divisor == dividend)
{
return 1;
}
else if( divisor > dividend)
{
return 0;
}
else // divisor < dividend
{
while(divisor <= dividend)
{
divisor = divisor << 1;
r
Thank You
--vinay
On Mar 28, 10:13 pm, "Atamurad Hezretkuliyev" <[EMAIL PROTECTED]>
wrote:
> http://en.wikipedia.org/wiki/Assignment_problemhttp://en.wikipedia.org/wiki/Hungarian_algorithm
--~--~-~--~~~---~--~~
You received this mess
The example given by Atamurad suits my need..
On Mar 28, 4:09 pm, "vinay" <[EMAIL PROTECTED]> wrote:
> Hai all,
> Given a N X N Matrix( with +ve integers), How to find the elements,
> such that only one element from each row and one element from each
> column and su
Hai all,
Given a N X N Matrix( with +ve integers), How to find the elements,
such that only one element from each row and one element from each
column and sum of the elements is minimum.
Thanks
--vinay
--~--~-~--~~~---~--~~
You received this message because you
22 matches
Mail list logo