Re: [algogeeks] Re: adobe question

2012-10-21 Thread Jaspreet Singh
here's an O(lgn) soln :
matrix form of fib :
http://en.wikipedia.org/wiki/Fibonacci_number#Matrix_form
and then use the divide and conquer for calculating (A)^n in O(lgn).

Thanks

On Sun, Oct 21, 2012 at 7:10 PM, rahul sharma wrote:

> I have implemented this code below:-
> #include
> int fibs(int);
> int fibb[9]={0};
> int fib(int n)
> {
>if ( n <= 1 )
>{
> fibb[1]=n;
>return n;
>   }
>
>  return fibs(n-1)+fibs(n-2);
>
>
>}
>
>  int fibs(int n)
>  {
>
>  if( fibb[n]!=0)
>  return fibb[n];
>  int temp=fib(n);
>  fibb[n]=temp;
>  return temp;
>
>
> }
>
>
>
> int main ()
> {
>   int n = 9;
>
>   printf("%d", fib(n));
>   for(int i=0;i<9;i++)
>   printf("\n%d",fibb[i]);
>   getchar();
>   return 0;
> }
>
>
> but if i call for 9..then the lookup/fibb should contain upto 9 so that
> when i call for 11 it would take only two computaion..but my code storing
> in fibb upto 8 i.e the element for which we called its result is not
> getting stored in fibbonicci...so if i call for 9 it would store till
> fibb[8].but it should store for 9 also.i am not able to get that
> statemnt...plz correct my code..
>
> On Sun, Oct 21, 2012 at 6:39 PM, rahul sharma wrote:
>
>> on wiki they are saying(in case of factorial) that once function called
>> with 5!..then if we call with 6! then only one iteration neededi just
>> wana confirm that both these calls occur simultaneously..i mean like
>>
>> fact(5);
>> ...
>> ...
>> ...
>> fact(6)
>>
>>
>> or
>> fact (5).stop execution.add statemet
>> fact(6)
>>
>> if we do like this this will delete old fact(5) as emmory has been
>> deleted after execution..am i ryt??or there is something in memorization
>> that preserve the memory
>>
>>
>> On Sun, Oct 21, 2012 at 6:32 PM, rahul sharma wrote:
>>
>>> sachin
>>> i have no idea about floowong
>>>
>>> Iterator it = optimizationMap.find(n);
>>>
>>> can you provide me a clear definition
>>>
>>> On Sun, Oct 21, 2012 at 6:30 PM, rahul sharma 
>>> wrote:
>>>
 yesi have read somehwr that we can save the already calculated
 values..thtas wat i did.now after ur sol i came to know abput
 memorization..thnx


 On Sun, Oct 21, 2012 at 5:58 PM, Sachin Maheshwari <
 sachin.maheshw...@gmail.com> wrote:

> Rahul,
> Your solution in principle is doing a similar work. If you look
> closely you are using fibb array to do memoization of already calculated
> values.
>
> Regards,
> Sachin
>
> On Sun, Oct 21, 2012 at 5:47 PM, rahul sharma  > wrote:
>
>>  I came up with follwoing solution...plz comment.
>> #include
>> int fib(int n,int fibb[])
>> {
>>if ( n <= 1 )
>>{
>> fibb[1]=n;
>>return n;
>>   }
>>   fib(n-1,fibb);
>>   fibb[n]=fibb[n-1]+fibb[n-2];
>>   return fibb[n];
>> }
>>
>> int main ()
>> {
>>   int n = 9;int fibb[9];
>>   fibb[0]=0;
>>   printf("%d", fib(n,fibb));
>>   getchar();
>>   return 0;
>> }
>>
>> plz comment
>> On Sun, Oct 21, 2012 at 5:16 PM, rahul sharma <
>> rahul23111...@gmail.com> wrote:
>>
>>> #include
>>>  int fib(int n)
>>>  {
>>> if ( n <= 1 )
>>>return n;
>>> return fib(n-1) + fib(n-2);
>>>  }
>>>
>>> How can we reduce no of computations with the above
>>> code(iterative solution not allowed).
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google
>> Groups "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Regards,
> Sachin Maheshwari
> Cell phone: +91.7259917298
>
> "If we admit that human life can be ruled by reason; the possibility
> of life is destroyed." - Alexander Supertramp
>
> --
> You received this message because you are subscribed to the Google
> Groups "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>


>>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this

Re: [algogeeks] Re: Microsoft Interview Question

2012-10-16 Thread Jaspreet Singh
its not the best i think and also not a dp solution but can be done by this.

On Tue, Oct 16, 2012 at 4:28 AM, Jaspreet Singh
wrote:

> BFS
>
>
> On Sun, Oct 14, 2012 at 4:21 PM, Rahul Kumar Patle <
> patlerahulku...@gmail.com> wrote:
>
>> response awaited!!!
>> anyone??
>>
>> On Sat, Oct 13, 2012 at 12:31 AM, Rahul Kumar Patle <
>> patlerahulku...@gmail.com> wrote:
>>
>>> Pls help to solve this que.. does any one have DP solution for following
>>> que.
>>>
>>> http://www.geeksforgeeks.org/archives/24488
>>> section 5/question 2
>>>
>>> Write a program to find all the possible paths from a starting point to
>>> dest point in a maze(2-D array).
>>>
>>> ex: 1 0 1 0
>>> 1 1 1 1
>>> 0 1 0 1
>>> 0 0 1 1
>>>
>>> If there is a block it’s represented by 0.
>>> If there is a path it’s represented by 1.
>>>
>>>
>>>
>>> --
>>> Thanks and Regards:
>>> Rahul Kumar Patle
>>> M.Tech, School of Information Technology
>>> Indian Institute of Technology, Kharagpur-721302, 
>>> India<http://www.iitkgp.ac.in/>
>>> Mobile No: +91-8798049298, +91-9424738542
>>> Alternate Email: rahulkumarpa...@hotmail.com
>>> [image: 
>>> Linkedin]<http://www.linkedin.com/profile/view?id=106245716&trk=tab_pro>
>>> [image: Twitter] <https://twitter.com/rahulkumarpatle>
>>> <https://www.facebook.com/rkpatle>
>>>
>>>
>>
>>
>> --
>> Thanks and Regards:
>> Rahul Kumar Patle
>> M.Tech, School of Information Technology
>> Indian Institute of Technology, Kharagpur-721302, 
>> India<http://www.iitkgp.ac.in/>
>> Mobile No: +91-8798049298, +91-9424738542
>> Alternate Email: rahulkumarpa...@hotmail.com
>> [image: 
>> Linkedin]<http://www.linkedin.com/profile/view?id=106245716&trk=tab_pro>
>> [image: Twitter] <https://twitter.com/rahulkumarpatle>
>> <https://www.facebook.com/rkpatle>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Microsoft Interview Question

2012-10-16 Thread Jaspreet Singh
BFS

On Sun, Oct 14, 2012 at 4:21 PM, Rahul Kumar Patle <
patlerahulku...@gmail.com> wrote:

> response awaited!!!
> anyone??
>
> On Sat, Oct 13, 2012 at 12:31 AM, Rahul Kumar Patle <
> patlerahulku...@gmail.com> wrote:
>
>> Pls help to solve this que.. does any one have DP solution for following
>> que.
>>
>> http://www.geeksforgeeks.org/archives/24488
>> section 5/question 2
>>
>> Write a program to find all the possible paths from a starting point to
>> dest point in a maze(2-D array).
>>
>> ex:  1 0 1 0
>>  1 1 1 1
>>  0 1 0 1
>>  0 0 1 1
>>
>> If there is a block it’s represented by 0.
>> If there is a path it’s represented by 1.
>>
>>
>>
>> --
>> Thanks and Regards:
>> Rahul Kumar Patle
>> M.Tech, School of Information Technology
>> Indian Institute of Technology, Kharagpur-721302, 
>> India
>> Mobile No: +91-8798049298, +91-9424738542
>> Alternate Email: rahulkumarpa...@hotmail.com
>> [image: 
>> Linkedin]
>> [image: Twitter] 
>> 
>>
>>
>
>
> --
> Thanks and Regards:
> Rahul Kumar Patle
> M.Tech, School of Information Technology
> Indian Institute of Technology, Kharagpur-721302, 
> India
> Mobile No: +91-8798049298, +91-9424738542
> Alternate Email: rahulkumarpa...@hotmail.com
> [image: 
> Linkedin]
> [image: Twitter] 
> 
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: can we check a number has last digit 5 or not using bitwise operator.

2012-10-11 Thread Jaspreet Singh
Nice solution Dave sir .. but if you know can you please tell us what is
the internal structure of "%" operator .. i mean it has also to be done by
bitwise any way .. so can't we implement that in HHLs.

Thanks

On Thu, Oct 11, 2012 at 1:25 AM, Dave  wrote:

> @Mohit: The decimal representation of a number ends in 5 if its low order
> bit is 1 and it is divisibile by 5.
>
> An algorithm using bitwise operations to check for divisibility by 5 is
> given at
> https://groups.google.com/d/msg/algogeeks/I5HWmwKW_ks/n38FWJSd0l8J.
>
> It probably is not as fast as (n & 1) && (n % 5 == 0), though.
>
> Dave
>
> On Wednesday, October 10, 2012 4:06:28 AM UTC-5, mohit mishra wrote:
>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/algogeeks/-/bRupe9F1MUIJ.
>
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Min Edges to be added to DAG to make it Strongly connected?

2012-10-09 Thread Jaspreet Singh
oh ok .. but then i think this ques should have a adv version for cyclic
too bcoz anyhow u have to make it at last a cyclic to make it fully
connected then why not the input should be like that.

Thanks

On Tue, Oct 9, 2012 at 10:13 PM, Saurabh Kumar  wrote:

> We are attempting for DAGs only.
> Your graph is not acyclic.  :)
>
>
> On 9 October 2012 21:57, Jaspreet Singh  wrote:
>
>> What if this :-
>> a-»b
>> ^--' c
>>
>> here max of both is 1 but ans is 2.
>> On Oct 8, 2012 11:38 PM, "Saurabh Kumar"  wrote:
>>
>>> You'd need:  max(#vertices-with-0in-degree, #vertices-with-0out-degree)
>>> edges at least.
>>>
>>> On 8 October 2012 20:20, bharat b  wrote:
>>>
>>>> @jaspreet: take an ex:
>>>>  B->A
>>>> B->C
>>>> B->D
>>>> Here the no.of zero-indegree is one . But its not the correct ans.
>>>>
>>>>
>>>> On Mon, Oct 8, 2012 at 1:19 AM, Jaspreet Singh <
>>>> jassajjassaj...@gmail.com> wrote:
>>>>
>>>>> count the no. of nodes having 0 in-degree.
>>>>>
>>>>>
>>>>> On Mon, Oct 8, 2012 at 12:44 AM, atul anand 
>>>>> wrote:
>>>>>
>>>>>> yeah i read it wrongly .. i thought ques was asking to find total
>>>>>> strongly connected component in the graph
>>>>>>
>>>>>> On 10/7/12, bharat b  wrote:
>>>>>> > @atul : if there is no cut vertex, that doesn't mean that graph is
>>>>>> strongly
>>>>>> > connected ...
>>>>>> >
>>>>>> >
>>>>>> > On Sat, Oct 6, 2012 at 7:37 PM, atul anand 
>>>>>> wrote:
>>>>>> >
>>>>>> >> find no. of cut vertex in the DAGthat will be the ans.
>>>>>> >> On 6 Oct 2012 19:33, "KK"  wrote:
>>>>>> >>
>>>>>> >>> Given a DAG(Directed Acyclic Graph). How to find out the minimum
>>>>>> number
>>>>>> >>> of edges that needs to be added so that the given graph becomes
>>>>>> Strongly
>>>>>> >>> Connected?
>>>>>> >>>
>>>>>> >>> --
>>>>>> >>> You received this message because you are subscribed to the Google
>>>>>> >>> Groups
>>>>>> >>> "Algorithm Geeks" group.
>>>>>> >>> To view this discussion on the web visit
>>>>>> >>> https://groups.google.com/d/msg/algogeeks/-/PbR3j9S5OXUJ.
>>>>>> >>> To post to this group, send email to algogeeks@googlegroups.com.
>>>>>> >>> To unsubscribe from this group, send email to
>>>>>> >>> algogeeks+unsubscr...@googlegroups.com.
>>>>>> >>> For more options, visit this group at
>>>>>> >>> http://groups.google.com/group/algogeeks?hl=en.
>>>>>> >>>
>>>>>> >>  --
>>>>>> >> You received this message because you are subscribed to the Google
>>>>>> Groups
>>>>>> >> "Algorithm Geeks" group.
>>>>>> >> To post to this group, send email to algogeeks@googlegroups.com.
>>>>>> >> To unsubscribe from this group, send email to
>>>>>> >> algogeeks+unsubscr...@googlegroups.com.
>>>>>> >> For more options, visit this group at
>>>>>> >> http://groups.google.com/group/algogeeks?hl=en.
>>>>>> >>
>>>>>> >
>>>>>> > --
>>>>>> > You received this message because you are subscribed to the Google
>>>>>> Groups
>>>>>> > "Algorithm Geeks" group.
>>>>>> > To post to this group, send email to algogeeks@googlegroups.com.
>>>>>> > To unsubscribe from this group, send email to
>>>>>> > algogeeks+unsubscr...@googlegroups.com.
>>>>>> > For more options, visit this group at
>>>>>> > http://groups.google.com/group/algogeeks?hl=en.
>>>>>> >
>>>>>> >
>>>>>>
>>>>>> --
>>>>>> You received this message because you are subscribed to t

Re: [algogeeks] Min Edges to be added to DAG to make it Strongly connected?

2012-10-09 Thread Jaspreet Singh
What if this :-
a-»b
^--' c

here max of both is 1 but ans is 2.
On Oct 8, 2012 11:38 PM, "Saurabh Kumar"  wrote:

> You'd need:  max(#vertices-with-0in-degree, #vertices-with-0out-degree)
> edges at least.
>
> On 8 October 2012 20:20, bharat b  wrote:
>
>> @jaspreet: take an ex:
>>  B->A
>> B->C
>> B->D
>> Here the no.of zero-indegree is one . But its not the correct ans.
>>
>>
>> On Mon, Oct 8, 2012 at 1:19 AM, Jaspreet Singh > > wrote:
>>
>>> count the no. of nodes having 0 in-degree.
>>>
>>>
>>> On Mon, Oct 8, 2012 at 12:44 AM, atul anand wrote:
>>>
>>>> yeah i read it wrongly .. i thought ques was asking to find total
>>>> strongly connected component in the graph
>>>>
>>>> On 10/7/12, bharat b  wrote:
>>>> > @atul : if there is no cut vertex, that doesn't mean that graph is
>>>> strongly
>>>> > connected ...
>>>> >
>>>> >
>>>> > On Sat, Oct 6, 2012 at 7:37 PM, atul anand 
>>>> wrote:
>>>> >
>>>> >> find no. of cut vertex in the DAGthat will be the ans.
>>>> >> On 6 Oct 2012 19:33, "KK"  wrote:
>>>> >>
>>>> >>> Given a DAG(Directed Acyclic Graph). How to find out the minimum
>>>> number
>>>> >>> of edges that needs to be added so that the given graph becomes
>>>> Strongly
>>>> >>> Connected?
>>>> >>>
>>>> >>> --
>>>> >>> You received this message because you are subscribed to the Google
>>>> >>> Groups
>>>> >>> "Algorithm Geeks" group.
>>>> >>> To view this discussion on the web visit
>>>> >>> https://groups.google.com/d/msg/algogeeks/-/PbR3j9S5OXUJ.
>>>> >>> To post to this group, send email to algogeeks@googlegroups.com.
>>>> >>> To unsubscribe from this group, send email to
>>>> >>> algogeeks+unsubscr...@googlegroups.com.
>>>> >>> For more options, visit this group at
>>>> >>> http://groups.google.com/group/algogeeks?hl=en.
>>>> >>>
>>>> >>  --
>>>> >> You received this message because you are subscribed to the Google
>>>> Groups
>>>> >> "Algorithm Geeks" group.
>>>> >> To post to this group, send email to algogeeks@googlegroups.com.
>>>> >> To unsubscribe from this group, send email to
>>>> >> algogeeks+unsubscr...@googlegroups.com.
>>>> >> For more options, visit this group at
>>>> >> http://groups.google.com/group/algogeeks?hl=en.
>>>> >>
>>>> >
>>>> > --
>>>> > You received this message because you are subscribed to the Google
>>>> Groups
>>>> > "Algorithm Geeks" group.
>>>> > To post to this group, send email to algogeeks@googlegroups.com.
>>>> > To unsubscribe from this group, send email to
>>>> > algogeeks+unsubscr...@googlegroups.com.
>>>> > For more options, visit this group at
>>>> > http://groups.google.com/group/algogeeks?hl=en.
>>>> >
>>>> >
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Algorithm Geeks" group.
>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>> To unsubscribe from this group, send email to
>>>> algogeeks+unsubscr...@googlegroups.com.
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>
>>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Min Edges to be added to DAG to make it Strongly connected?

2012-10-08 Thread Jaspreet Singh
ok the algo will go like this :
count no of nodes having only indegree 0 , only outdegree 0 and both 0. say
in_count,out_count and both_count are the corresponding counts.
now decrease the counts accordingly if u found a matching like u can
decrease in_count by both_count if both_count0 and in
degree>0 your graph is connected !! and i m just making that.

On Mon, Oct 8, 2012 at 8:37 PM, Jaspreet Singh wrote:

> yeah you are correct bharat .. so i think it should be no. of nodes
> having 0 (in-degree + out-degree). what say ?
>
>
> On Mon, Oct 8, 2012 at 8:20 PM, bharat b wrote:
>
>> @jaspreet: take an ex:
>>  B->A
>> B->C
>> B->D
>> Here the no.of zero-indegree is one . But its not the correct ans.
>>
>>
>> On Mon, Oct 8, 2012 at 1:19 AM, Jaspreet Singh > > wrote:
>>
>>> count the no. of nodes having 0 in-degree.
>>>
>>>
>>> On Mon, Oct 8, 2012 at 12:44 AM, atul anand wrote:
>>>
>>>> yeah i read it wrongly .. i thought ques was asking to find total
>>>> strongly connected component in the graph
>>>>
>>>> On 10/7/12, bharat b  wrote:
>>>> > @atul : if there is no cut vertex, that doesn't mean that graph is
>>>> strongly
>>>> > connected ...
>>>> >
>>>> >
>>>> > On Sat, Oct 6, 2012 at 7:37 PM, atul anand 
>>>> wrote:
>>>> >
>>>> >> find no. of cut vertex in the DAGthat will be the ans.
>>>> >> On 6 Oct 2012 19:33, "KK"  wrote:
>>>> >>
>>>> >>> Given a DAG(Directed Acyclic Graph). How to find out the minimum
>>>> number
>>>> >>> of edges that needs to be added so that the given graph becomes
>>>> Strongly
>>>> >>> Connected?
>>>> >>>
>>>> >>> --
>>>> >>> You received this message because you are subscribed to the Google
>>>> >>> Groups
>>>> >>> "Algorithm Geeks" group.
>>>> >>> To view this discussion on the web visit
>>>> >>> https://groups.google.com/d/msg/algogeeks/-/PbR3j9S5OXUJ.
>>>> >>> To post to this group, send email to algogeeks@googlegroups.com.
>>>> >>> To unsubscribe from this group, send email to
>>>> >>> algogeeks+unsubscr...@googlegroups.com.
>>>> >>> For more options, visit this group at
>>>> >>> http://groups.google.com/group/algogeeks?hl=en.
>>>> >>>
>>>> >>  --
>>>> >> You received this message because you are subscribed to the Google
>>>> Groups
>>>> >> "Algorithm Geeks" group.
>>>> >> To post to this group, send email to algogeeks@googlegroups.com.
>>>> >> To unsubscribe from this group, send email to
>>>> >> algogeeks+unsubscr...@googlegroups.com.
>>>> >> For more options, visit this group at
>>>> >> http://groups.google.com/group/algogeeks?hl=en.
>>>> >>
>>>> >
>>>> > --
>>>> > You received this message because you are subscribed to the Google
>>>> Groups
>>>> > "Algorithm Geeks" group.
>>>> > To post to this group, send email to algogeeks@googlegroups.com.
>>>> > To unsubscribe from this group, send email to
>>>> > algogeeks+unsubscr...@googlegroups.com.
>>>> > For more options, visit this group at
>>>> > http://groups.google.com/group/algogeeks?hl=en.
>>>> >
>>>> >
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Algorithm Geeks" group.
>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>> To unsubscribe from this group, send email to
>>>> algogeeks+unsubscr...@googlegroups.com.
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>
>>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Min Edges to be added to DAG to make it Strongly connected?

2012-10-08 Thread Jaspreet Singh
yeah you are correct bharat .. so i think it should be no. of nodes having
0 (in-degree + out-degree). what say ?

On Mon, Oct 8, 2012 at 8:20 PM, bharat b wrote:

> @jaspreet: take an ex:
>  B->A
> B->C
> B->D
> Here the no.of zero-indegree is one . But its not the correct ans.
>
>
> On Mon, Oct 8, 2012 at 1:19 AM, Jaspreet Singh 
> wrote:
>
>> count the no. of nodes having 0 in-degree.
>>
>>
>> On Mon, Oct 8, 2012 at 12:44 AM, atul anand wrote:
>>
>>> yeah i read it wrongly .. i thought ques was asking to find total
>>> strongly connected component in the graph
>>>
>>> On 10/7/12, bharat b  wrote:
>>> > @atul : if there is no cut vertex, that doesn't mean that graph is
>>> strongly
>>> > connected ...
>>> >
>>> >
>>> > On Sat, Oct 6, 2012 at 7:37 PM, atul anand 
>>> wrote:
>>> >
>>> >> find no. of cut vertex in the DAGthat will be the ans.
>>> >> On 6 Oct 2012 19:33, "KK"  wrote:
>>> >>
>>> >>> Given a DAG(Directed Acyclic Graph). How to find out the minimum
>>> number
>>> >>> of edges that needs to be added so that the given graph becomes
>>> Strongly
>>> >>> Connected?
>>> >>>
>>> >>> --
>>> >>> You received this message because you are subscribed to the Google
>>> >>> Groups
>>> >>> "Algorithm Geeks" group.
>>> >>> To view this discussion on the web visit
>>> >>> https://groups.google.com/d/msg/algogeeks/-/PbR3j9S5OXUJ.
>>> >>> To post to this group, send email to algogeeks@googlegroups.com.
>>> >>> To unsubscribe from this group, send email to
>>> >>> algogeeks+unsubscr...@googlegroups.com.
>>> >>> For more options, visit this group at
>>> >>> http://groups.google.com/group/algogeeks?hl=en.
>>> >>>
>>> >>  --
>>> >> You received this message because you are subscribed to the Google
>>> Groups
>>> >> "Algorithm Geeks" group.
>>> >> To post to this group, send email to algogeeks@googlegroups.com.
>>> >> To unsubscribe from this group, send email to
>>> >> algogeeks+unsubscr...@googlegroups.com.
>>> >> For more options, visit this group at
>>> >> http://groups.google.com/group/algogeeks?hl=en.
>>> >>
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> Groups
>>> > "Algorithm Geeks" group.
>>> > To post to this group, send email to algogeeks@googlegroups.com.
>>> > To unsubscribe from this group, send email to
>>> > algogeeks+unsubscr...@googlegroups.com.
>>> > For more options, visit this group at
>>> > http://groups.google.com/group/algogeeks?hl=en.
>>> >
>>> >
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Min Edges to be added to DAG to make it Strongly connected?

2012-10-08 Thread Jaspreet Singh
count the no. of nodes having 0 in-degree.

On Mon, Oct 8, 2012 at 12:44 AM, atul anand  wrote:

> yeah i read it wrongly .. i thought ques was asking to find total
> strongly connected component in the graph
>
> On 10/7/12, bharat b  wrote:
> > @atul : if there is no cut vertex, that doesn't mean that graph is
> strongly
> > connected ...
> >
> >
> > On Sat, Oct 6, 2012 at 7:37 PM, atul anand 
> wrote:
> >
> >> find no. of cut vertex in the DAGthat will be the ans.
> >> On 6 Oct 2012 19:33, "KK"  wrote:
> >>
> >>> Given a DAG(Directed Acyclic Graph). How to find out the minimum number
> >>> of edges that needs to be added so that the given graph becomes
> Strongly
> >>> Connected?
> >>>
> >>> --
> >>> You received this message because you are subscribed to the Google
> >>> Groups
> >>> "Algorithm Geeks" group.
> >>> To view this discussion on the web visit
> >>> https://groups.google.com/d/msg/algogeeks/-/PbR3j9S5OXUJ.
> >>> To post to this group, send email to algogeeks@googlegroups.com.
> >>> To unsubscribe from this group, send email to
> >>> algogeeks+unsubscr...@googlegroups.com.
> >>> For more options, visit this group at
> >>> http://groups.google.com/group/algogeeks?hl=en.
> >>>
> >>  --
> >> You received this message because you are subscribed to the Google
> Groups
> >> "Algorithm Geeks" group.
> >> To post to this group, send email to algogeeks@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> algogeeks+unsubscr...@googlegroups.com.
> >> For more options, visit this group at
> >> http://groups.google.com/group/algogeeks?hl=en.
> >>
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Algorithm Geeks" group.
> > To post to this group, send email to algogeeks@googlegroups.com.
> > To unsubscribe from this group, send email to
> > algogeeks+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> > http://groups.google.com/group/algogeeks?hl=en.
> >
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] C output

2012-10-06 Thread Jaspreet Singh
because of null char in 1st

On Sat, Oct 6, 2012 at 5:53 PM, rahul sharma wrote:

> char str[]="ab";
> char str1[]={'a','b'};
>
> sizeof(str) ...o/p is 3
> sizeof(str1)o/p is 2..
>
> Why so
> plz explain...--
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Data Structure

2012-09-21 Thread Jaspreet Singh
doubly linked lists or custom stacks, i guess

On Tue, Sep 18, 2012 at 3:55 PM, Sheetal Naidu wrote:

> sqlite database for mozilla...maybe hashtable
>
>
> On 18 September 2012 13:20, Navin Kumar  wrote:
>
>>
>> Which data structure is used to maintain browser history?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/algogeeks/-/MCj-0bFwvV0J.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> - A.Sheetal
>   B.tech, Final yr,
>   Department Of Information Technology,
>   NIT, Durgapur
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: what will happen in the village

2009-09-13 Thread jaspreet singh
the demons share the sleeping man amongst themselves.and hence all
fall asleep and cant eat each other either...

On Sun, Sep 13, 2009 at 5:42 PM, ankur aggarwal wrote:

> nothing happens...
>
> On Sun, Sep 13, 2009 at 5:32 PM, Vikram Sridar 
> wrote:
>
>> The man lives forever... sleeps forever actually
>>
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/algogeeks
-~--~~~~--~~--~--~---