[algogeeks] Solution Book

2013-03-17 Thread shady
Does anyone have solutions for "Let Us C" by Yashwant Kanetkar ?
If yes, then please PM me.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to algogeeks+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[algogeeks] [Off topic] Call for Moderators for Algogeeks

2013-03-13 Thread shady
Hi,
Does anyone wants to be moderator ? We want someone who is actively
participating in discussions and can frequently check the pending tasks for
moderation.

Shady

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to algogeeks+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[algogeeks] Proof Dutch national flag problem

2013-02-26 Thread shady
Any proof for this ?
http://www.geeksforgeeks.org/sort-an-array-of-0s-1s-and-2s/

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to algogeeks+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [algogeeks] Number of paths

2013-02-21 Thread shady
How did you directly arrive at that solution ? Can you please explain

On Thu, Feb 21, 2013 at 1:52 PM, Gaurav Rana  wrote:

> (m+n)C(n)
>
>
> On Thu, Feb 21, 2013 at 1:26 PM, shady  wrote:
>
>> Given a matrix of size mXn, find the number of paths from the top left
>> cell to the bottom right cell.
>>
>> BFS is one way... any other approach ?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to algogeeks+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to algogeeks+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[algogeeks] Number of paths

2013-02-20 Thread shady
Given a matrix of size mXn, find the number of paths from the top left cell
to the bottom right cell.

BFS is one way... any other approach ?

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to algogeeks+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[algogeeks] Question

2013-02-16 Thread shady
Given a number of time slots – start time and end time,“a b”, find any
specific time with the maximum number of overlapping.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to algogeeks+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [algogeeks]

2013-01-29 Thread shady
Yes I agree to it, it won't be random... but suppose I don't want a case
when all elements are at their own position because that case means
that they are not shuffled. Perhaps we can run the algorithm again, since
the probability of same event occurring two times in a row will be very
less.

On Tue, Jan 29, 2013 at 12:13 AM, Carl Barton wrote:

> Because then it's not a random shuffle? If you randomly shuffle something
> the order you currently have should be just as likely as any other
>
>
> On 28 January 2013 12:29, shady  wrote:
>
>> Why do we use Fisher Yates 
>> algorithm<http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm>
>>  when
>> in the worst case there is no shuffle at all ?
>> we can modify it by generating random number not inclusive of the element
>> that we are about to swap
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to algogeeks+unsubscr...@googlegroups.com.
>
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to algogeeks+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[algogeeks]

2013-01-28 Thread shady
Why do we use Fisher Yates
algorithm
when
in the worst case there is no shuffle at all ?
we can modify it by generating random number not inclusive of the element
that we are about to swap

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




[algogeeks] Check simple polygon

2013-01-20 Thread shady
How to check if polygon is simple based on given list of points ?

-- 




Re: [algogeeks] Pointers Usage

2013-01-02 Thread shady
I don't know what you are saying ?
First learn to respond and comprehend. This group is for discussion.


"alternative lang like Java but when and if people are involved in project
which are core technology" LOL, only if you knew what you are writing.

On Wed, Jan 2, 2013 at 1:53 PM, Prem Krishna Chettri wrote:

> I donno what and why are you talking about.
>
>  Follow the advise and learn the way , you want to. Coz, things are
> there where we NEED pointer, its not a additional luxury we have in
> programming lang, its the necessity.  So if some body wanna turn their head
> off bcoz its complex, hard than there are alternative lang like Java but
> when and if people are involved in project which are core technology and
> they are genuine engineer, than they cannot keep ourself off from this.
>
>
>
>
> On Wed, Jan 2, 2013 at 12:51 PM, shady  wrote:
>
>> it is advised to avoid using pointers because of the overhead of
>> accessing different blocks of memory. Apart from that it also results in
>> more space consumption.
>>
>> On Wed, Jan 2, 2013 at 11:23 AM, Prem Krishna Chettri > > wrote:
>>
>>> Boss.. thats kinda bit basic to ask anyways.. lemme give bit of details.
>>>
>>> Languages with pointer have WAY more flexibility to write a code upto
>>> any segment (I mean lower layer of programming like Device Driver) as they
>>> are directly talking to memory, where as if we don't have pointer we need
>>> to take a help of mechanism other than pointer to talk with raw memory.
>>>
>>>So, basically, U can say that pointer are the basic back bone of
>>> memory management in any language. Infact, If U use Java and Say if don't
>>> have pointer that U are wrong , even java use pointer's but in background
>>> with the help of JVM.
>>>
>>>  As far as my expr is concern, with pointer lang is easy to learn
>>> and code but in long run you will loose the charm of coding.
>>>
>>>   In above comment, I would assume we are considering the programming
>>> languages and not the scripting languages.
>>>
>>> On Wed, Jan 2, 2013 at 11:03 AM, shady  wrote:
>>>
>>>>  optimization of what ?
>>>> can you explain your answer ?
>>>>
>>>>
>>>> On Wed, Jan 2, 2013 at 10:31 AM, rahul  wrote:
>>>>
>>>>> Optimization.
>>>>>
>>>>> On Wed, Jan 2, 2013 at 1:35 AM, shady  wrote:
>>>>>
>>>>>> Why do we use pointers at all considering space as a factor other
>>>>>> than allocating memory dynamically does it have any other use ?
>>>>>>
>>>>>> to store an integer
>>>>>> (int *) = 8 bytes, and while making it point to an integer location
>>>>>> would cost another 4 bytes, total = 12 bytes ... compared to directly
>>>>>> taking (int) = 4 bytes
>>>>>>
>>>>>> --
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>  --
>>>>>
>>>>>
>>>>>
>>>>
>>>>  --
>>>>
>>>>
>>>>
>>>
>>>  --
>>>
>>>
>>>
>>
>>  --
>>
>>
>>
>
>  --
>
>
>

-- 




Re: [algogeeks] Pointers Usage

2013-01-01 Thread shady
it is advised to avoid using pointers because of the overhead of accessing
different blocks of memory. Apart from that it also results in more space
consumption.

On Wed, Jan 2, 2013 at 11:23 AM, Prem Krishna Chettri wrote:

> Boss.. thats kinda bit basic to ask anyways.. lemme give bit of details.
>
> Languages with pointer have WAY more flexibility to write a code upto any
> segment (I mean lower layer of programming like Device Driver) as they are
> directly talking to memory, where as if we don't have pointer we need to
> take a help of mechanism other than pointer to talk with raw memory.
>
>So, basically, U can say that pointer are the basic back bone of
> memory management in any language. Infact, If U use Java and Say if don't
> have pointer that U are wrong , even java use pointer's but in background
> with the help of JVM.
>
>  As far as my expr is concern, with pointer lang is easy to learn and
> code but in long run you will loose the charm of coding.
>
>   In above comment, I would assume we are considering the programming
> languages and not the scripting languages.
>
> On Wed, Jan 2, 2013 at 11:03 AM, shady  wrote:
>
>> optimization of what ?
>> can you explain your answer ?
>>
>>
>> On Wed, Jan 2, 2013 at 10:31 AM, rahul  wrote:
>>
>>> Optimization.
>>>
>>> On Wed, Jan 2, 2013 at 1:35 AM, shady  wrote:
>>>
>>>> Why do we use pointers at all considering space as a factor other
>>>> than allocating memory dynamically does it have any other use ?
>>>>
>>>> to store an integer
>>>> (int *) = 8 bytes, and while making it point to an integer location
>>>> would cost another 4 bytes, total = 12 bytes ... compared to directly
>>>> taking (int) = 4 bytes
>>>>
>>>> --
>>>>
>>>>
>>>>
>>>
>>>  --
>>>
>>>
>>>
>>
>>  --
>>
>>
>>
>
>  --
>
>
>

-- 




Re: [algogeeks] Pointers Usage

2013-01-01 Thread shady
optimization of what ?
can you explain your answer ?

On Wed, Jan 2, 2013 at 10:31 AM, rahul  wrote:

> Optimization.
>
> On Wed, Jan 2, 2013 at 1:35 AM, shady  wrote:
>
>> Why do we use pointers at all considering space as a factor other
>> than allocating memory dynamically does it have any other use ?
>>
>> to store an integer
>> (int *) = 8 bytes, and while making it point to an integer location would
>> cost another 4 bytes, total = 12 bytes ... compared to directly taking
>> (int) = 4 bytes
>>
>> --
>>
>>
>>
>
>  --
>
>
>

-- 




[algogeeks] Pointers Usage

2013-01-01 Thread shady
Why do we use pointers at all considering space as a factor other than
allocating memory dynamically does it have any other use ?

to store an integer
(int *) = 8 bytes, and while making it point to an integer location would
cost another 4 bytes, total = 12 bytes ... compared to directly taking
(int) = 4 bytes

-- 




[algogeeks] Skyline extraction

2012-12-28 Thread shady
How to extract the skyline from the rectangles ?
Given a set of rectangles with x coordinates and height, how to find the
skyline ?

-- 




Re: [algogeeks] Regex tester

2012-12-28 Thread shady
ya, it is correct, i misunderstood it..
any optimization on the same though ?

On Fri, Dec 28, 2012 at 9:55 AM, shady  wrote:

> @ritesh
> umm, well here's a simple testcase to show the problem in the code..
> isMatch("aa", "a*")
>
>
> On Thu, Dec 27, 2012 at 7:17 PM, Ritesh Mishra  wrote:
>
>> @shady : either the string will be stored in heap or stack. thus
>> accessing address in heap or stack is not going to give u seg fault . and
>> rest things are very well handled in the code :)
>> As saurabh sir has explained in thread
>> https://mail.google.com/mail/u/1/#inbox/13ba918bdb9aac9e
>> when seg fault occurs .
>> Regards,
>>
>> Ritesh Kumar Mishra
>> Information Technology
>> Third Year Undergraduate
>> MNNIT Allahabad
>>
>>
>> On Thu, Dec 27, 2012 at 6:43 PM, ~*~VICKY~*~ wrote:
>>
>>> I'm giving you a simple recursive code which i wrote long back. Please
>>> let me know if it fails for any cases. Ignore the funny cout's It used to
>>> help me debug and i'm lazy to remove it. :P :)
>>>
>>> #include
>>> #include
>>> using namespace std;
>>> /*
>>> abasjc a*c
>>> while(pattern[j] == '*' text[i] == pattern[j]) {i++; j++}
>>>  */
>>> bool match(string text, string pattern, int x, int y)
>>> {
>>> if(pattern.length() == y)
>>> {
>>> cout<<"hey\n";
>>> return 1;
>>> }
>>> if(text.length() == x)
>>> {
>>> cout<<"shit\n";
>>> return 0;
>>> }
>>> if(pattern[y] == '.' || text[x] == pattern[y])
>>> {
>>> cout<<"in match"<>> return match(text,pattern,x+1,y+1);
>>> }
>>> if(pattern[y] == '*')
>>> return match(text,pattern,x+1,y) || match(text,pattern,x+1,y+1)
>>> || match(text,pattern,x,y+1);
>>>
>>> if(text[x] != pattern[y])
>>> {
>>> cout<<"shit1\n";
>>>  return 0;
>>> }
>>>
>>> }
>>>
>>> int main()
>>> {
>>> string text,pattern;
>>> cin >> text >> pattern;
>>> cout << match(text, pattern,0, 0);
>>> }
>>>
>>> On Thu, Dec 27, 2012 at 6:10 PM, shady  wrote:
>>>
>>>> Thanks for the link Ritesh,
>>>> if (isMatch(s, p+2)) return true;
>>>> isnt this line incorrect in the code, as it can lead to segmentation
>>>> fault... how can we directly access p+2 element, we know for sure that p is
>>>> not '\0', but p+1 element can be '\0' , therefore leading to p+2 to be
>>>> undefined.
>>>>
>>>> On Thu, Dec 27, 2012 at 6:23 AM, Ritesh Mishra wrote:
>>>>
>>>>> try to solve it by recursion ..
>>>>> http://www.leetcode.com/2011/09/regular-expression-matching.html
>>>>>
>>>>>
>>>>>  Regards,
>>>>>
>>>>> Ritesh Kumar Mishra
>>>>> Information Technology
>>>>> Third Year Undergraduate
>>>>> MNNIT Allahabad
>>>>>
>>>>>
>>>>> On Sun, Dec 23, 2012 at 11:14 PM, Prem Krishna Chettri <
>>>>> hprem...@gmail.com> wrote:
>>>>>
>>>>>> Well I can tell you Something about design pattern to  solve this
>>>>>> case..
>>>>>>
>>>>>>What I mean is by using The State Machine Design Pattern,
>>>>>> Anyone can solve this. but Ofcourse it is complicated.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Sun, Dec 23, 2012 at 11:01 PM, shady  wrote:
>>>>>>
>>>>>>> that's the point, Have to implement it from scratch... otherwise
>>>>>>> java has regex and matcher, pattern to solve it...
>>>>>>>
>>>>>>>
>>>>>>> On Sun, Dec 23, 2012 at 10:28 PM, saurabh singh >>>>>> > wrote:
>>>>>>>
>>>>>>>> If you need to implement this for some project then python and java
>>>>>>>> have a very nice library
>>>>>>>>
>>>>>>>>
>>>>>>>> Saurabh Singh
>>>>>>>> B.Tech (Computer Science)
>>>>>>>> MNNIT
>>>>>>>> blog:geekinessthecoolway.blogspot.com
>>>>>>>>
>>>>>>>>
>>>>>>>> On Sun, Dec 23, 2012 at 7:48 PM, shady  wrote:
>>>>>>>>
>>>>>>>>>
>>>>>>>>> http://stackoverflow.com/questions/13144590/to-check-if-two-strings-match-with-alphabets-digits-and-special-characters
>>>>>>>>>
>>>>>>>>> any solution for this. we need to implement such regex
>>>>>>>>> tester
>>>>>>>>>
>>>>>>>>> some complex cases :
>>>>>>>>> *string** regex *   ->   * status*
>>>>>>>>> *
>>>>>>>>> *
>>>>>>>>> reesd   re*.d  ->   match
>>>>>>>>> re*eed reeed ->   match
>>>>>>>>>
>>>>>>>>> can some one help with this ?
>>>>>>>>>
>>>>>>>>>  --
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>  --
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>  --
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>  --
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>  --
>>>>>
>>>>>
>>>>>
>>>>
>>>>  --
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Cheers,
>>>
>>>   Vicky
>>>
>>> --
>>>
>>>
>>>
>>
>>  --
>>
>>
>>
>
>

-- 




Re: [algogeeks] Regex tester

2012-12-27 Thread shady
@ritesh
umm, well here's a simple testcase to show the problem in the code..
isMatch("aa", "a*")


On Thu, Dec 27, 2012 at 7:17 PM, Ritesh Mishra  wrote:

> @shady : either the string will be stored in heap or stack. thus accessing
> address in heap or stack is not going to give u seg fault . and rest things
> are very well handled in the code :)
> As saurabh sir has explained in thread
> https://mail.google.com/mail/u/1/#inbox/13ba918bdb9aac9e
> when seg fault occurs .
> Regards,
>
> Ritesh Kumar Mishra
> Information Technology
> Third Year Undergraduate
> MNNIT Allahabad
>
>
> On Thu, Dec 27, 2012 at 6:43 PM, ~*~VICKY~*~ wrote:
>
>> I'm giving you a simple recursive code which i wrote long back. Please
>> let me know if it fails for any cases. Ignore the funny cout's It used to
>> help me debug and i'm lazy to remove it. :P :)
>>
>> #include
>> #include
>> using namespace std;
>> /*
>> abasjc a*c
>> while(pattern[j] == '*' text[i] == pattern[j]) {i++; j++}
>>  */
>> bool match(string text, string pattern, int x, int y)
>> {
>> if(pattern.length() == y)
>> {
>> cout<<"hey\n";
>> return 1;
>> }
>> if(text.length() == x)
>> {
>> cout<<"shit\n";
>> return 0;
>> }
>> if(pattern[y] == '.' || text[x] == pattern[y])
>> {
>> cout<<"in match"<> return match(text,pattern,x+1,y+1);
>> }
>> if(pattern[y] == '*')
>> return match(text,pattern,x+1,y) || match(text,pattern,x+1,y+1)
>> || match(text,pattern,x,y+1);
>>
>> if(text[x] != pattern[y])
>> {
>> cout<<"shit1\n";
>>  return 0;
>> }
>>
>> }
>>
>> int main()
>> {
>> string text,pattern;
>> cin >> text >> pattern;
>> cout << match(text, pattern,0, 0);
>> }
>>
>> On Thu, Dec 27, 2012 at 6:10 PM, shady  wrote:
>>
>>> Thanks for the link Ritesh,
>>> if (isMatch(s, p+2)) return true;
>>> isnt this line incorrect in the code, as it can lead to segmentation
>>> fault... how can we directly access p+2 element, we know for sure that p is
>>> not '\0', but p+1 element can be '\0' , therefore leading to p+2 to be
>>> undefined.
>>>
>>> On Thu, Dec 27, 2012 at 6:23 AM, Ritesh Mishra wrote:
>>>
>>>> try to solve it by recursion ..
>>>> http://www.leetcode.com/2011/09/regular-expression-matching.html
>>>>
>>>>
>>>>  Regards,
>>>>
>>>> Ritesh Kumar Mishra
>>>> Information Technology
>>>> Third Year Undergraduate
>>>> MNNIT Allahabad
>>>>
>>>>
>>>> On Sun, Dec 23, 2012 at 11:14 PM, Prem Krishna Chettri <
>>>> hprem...@gmail.com> wrote:
>>>>
>>>>> Well I can tell you Something about design pattern to  solve this
>>>>> case..
>>>>>
>>>>>What I mean is by using The State Machine Design Pattern,
>>>>> Anyone can solve this. but Ofcourse it is complicated.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Sun, Dec 23, 2012 at 11:01 PM, shady  wrote:
>>>>>
>>>>>> that's the point, Have to implement it from scratch... otherwise java
>>>>>> has regex and matcher, pattern to solve it...
>>>>>>
>>>>>>
>>>>>> On Sun, Dec 23, 2012 at 10:28 PM, saurabh singh 
>>>>>> wrote:
>>>>>>
>>>>>>> If you need to implement this for some project then python and java
>>>>>>> have a very nice library
>>>>>>>
>>>>>>>
>>>>>>> Saurabh Singh
>>>>>>> B.Tech (Computer Science)
>>>>>>> MNNIT
>>>>>>> blog:geekinessthecoolway.blogspot.com
>>>>>>>
>>>>>>>
>>>>>>> On Sun, Dec 23, 2012 at 7:48 PM, shady  wrote:
>>>>>>>
>>>>>>>>
>>>>>>>> http://stackoverflow.com/questions/13144590/to-check-if-two-strings-match-with-alphabets-digits-and-special-characters
>>>>>>>>
>>>>>>>> any solution for this. we need to implement such regex
>>>>>>>> tester
>>>>>>>>
>>>>>>>> some complex cases :
>>>>>>>> *string** regex *   ->   * status*
>>>>>>>> *
>>>>>>>> *
>>>>>>>> reesd   re*.d  ->   match
>>>>>>>> re*eed reeed ->   match
>>>>>>>>
>>>>>>>> can some one help with this ?
>>>>>>>>
>>>>>>>>  --
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>  --
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>  --
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>  --
>>>>>
>>>>>
>>>>>
>>>>
>>>>  --
>>>>
>>>>
>>>>
>>>
>>>  --
>>>
>>>
>>>
>>
>>
>>
>> --
>> Cheers,
>>
>>   Vicky
>>
>> --
>>
>>
>>
>
>  --
>
>
>

-- 




Re: [algogeeks] Regex tester

2012-12-27 Thread shady
Thanks for the link Ritesh,
if (isMatch(s, p+2)) return true;
isnt this line incorrect in the code, as it can lead to segmentation
fault... how can we directly access p+2 element, we know for sure that p is
not '\0', but p+1 element can be '\0' , therefore leading to p+2 to be
undefined.

On Thu, Dec 27, 2012 at 6:23 AM, Ritesh Mishra  wrote:

> try to solve it by recursion ..
> http://www.leetcode.com/2011/09/regular-expression-matching.html
>
>
> Regards,
>
> Ritesh Kumar Mishra
> Information Technology
> Third Year Undergraduate
> MNNIT Allahabad
>
>
> On Sun, Dec 23, 2012 at 11:14 PM, Prem Krishna Chettri  > wrote:
>
>> Well I can tell you Something about design pattern to  solve this case..
>>
>>What I mean is by using The State Machine Design Pattern, Anyone
>> can solve this. but Ofcourse it is complicated.
>>
>>
>>
>>
>> On Sun, Dec 23, 2012 at 11:01 PM, shady  wrote:
>>
>>> that's the point, Have to implement it from scratch... otherwise java
>>> has regex and matcher, pattern to solve it...
>>>
>>>
>>> On Sun, Dec 23, 2012 at 10:28 PM, saurabh singh wrote:
>>>
>>>> If you need to implement this for some project then python and java
>>>> have a very nice library
>>>>
>>>>
>>>> Saurabh Singh
>>>> B.Tech (Computer Science)
>>>> MNNIT
>>>> blog:geekinessthecoolway.blogspot.com
>>>>
>>>>
>>>> On Sun, Dec 23, 2012 at 7:48 PM, shady  wrote:
>>>>
>>>>>
>>>>> http://stackoverflow.com/questions/13144590/to-check-if-two-strings-match-with-alphabets-digits-and-special-characters
>>>>>
>>>>> any solution for this. we need to implement such regex
>>>>> tester
>>>>>
>>>>> some complex cases :
>>>>> *string** regex *   ->   * status*
>>>>> *
>>>>> *
>>>>> reesd   re*.d  ->   match
>>>>> re*eed reeed ->   match
>>>>>
>>>>> can some one help with this ?
>>>>>
>>>>>  --
>>>>>
>>>>>
>>>>>
>>>>
>>>>  --
>>>>
>>>>
>>>>
>>>
>>>  --
>>>
>>>
>>>
>>
>>  --
>>
>>
>>
>
>  --
>
>
>

-- 




Re: [algogeeks] Regex tester

2012-12-23 Thread shady
that's the point, Have to implement it from scratch... otherwise java has
regex and matcher, pattern to solve it...

On Sun, Dec 23, 2012 at 10:28 PM, saurabh singh  wrote:

> If you need to implement this for some project then python and java have a
> very nice library
>
>
> Saurabh Singh
> B.Tech (Computer Science)
> MNNIT
> blog:geekinessthecoolway.blogspot.com
>
>
> On Sun, Dec 23, 2012 at 7:48 PM, shady  wrote:
>
>>
>> http://stackoverflow.com/questions/13144590/to-check-if-two-strings-match-with-alphabets-digits-and-special-characters
>>
>> any solution for this. we need to implement such regex
>> tester
>>
>> some complex cases :
>> *string** regex *   ->   * status*
>> *
>> *
>> reesd   re*.d  ->   match
>> re*eed reeed ->   match
>>
>> can some one help with this ?
>>
>>  --
>>
>>
>>
>
>  --
>
>
>

-- 




Re: [algogeeks] Re: Coin denomination

2012-12-22 Thread shady
We have *all kinds of denominations (1, 2, 3, R)*... therefore to cover
this range, we generally select coins like this 1, 2, 4, 8, 16... but in
this case... we can select* any N coins from R*, such that it *minimizes
the average coins used for all values in the range R*... like .

6 can be represented by 2, 4
15 -> (1, 2, 4, 8)
10 -> (2, 8)



On Sat, Dec 22, 2012 at 1:59 PM, Dave  wrote:

> @Shady: I'm not sure what you mean by "output N coins." With U.S. coins,
> you can need up to 4 pennies, 1 nickel, 2 dimes, 1 quarter, and 1
> half-dollar (or 4 pennies, 1 nickel, 2 dimes, and 3 quarters, if you don't
> use half-dollars, which are uncommon) to make any amount from 1 to 99
> cents. So should you output distinct coins (1,5,10,25,50), or repeat the
> coins the required number of times (1,1,1,1,5,10,10,25,50)?
>
> Dave
>
> On Friday, December 21, 2012 4:01:52 PM UTC-6, shady wrote:
>
>> Given R and N, output N coins in the range from 1 to R such that average
>> number of coins needed to represent all the number in the range is
>> minimized.
>>
>> Any idea ? hints ?
>>
>  --
>
>
>

-- 




[algogeeks] Coin denomination

2012-12-21 Thread shady
Given R and N, output N coins in the range from 1 to R such that average
number of coins needed to represent all the number in the range is
minimized.

Any idea ? hints ?

-- 




Re: [algogeeks] reverse a string efficiently

2012-11-26 Thread shady
oh, understood, i thought it takes constant time suppose if it takes,
then is there any benefit of this recursion compared to
reverse(str) = str[lastcharacter] + reverse(str(0, last-1))

it will reduce the recursion depth right ? No gain on time complexity though


a small correction, btw, T(n) = 2*T(n/2) + cn

On Tue, Nov 27, 2012 at 12:48 PM, atul anand wrote:

> considering '+' , here will take Cn time . Here '+' is for concatenate ,
> now this concatenation taking place in constant time?? , i dont think
> so..internally it will be adding elements to new m/m space and for that it
> need to traverse each character...so it will take cn time.
> so T(n) =T(n/2) + cn =  nlogn
>
> On Tue, Nov 27, 2012 at 11:17 AM, shady  wrote:
>
>> what is the time complexity of this?
>>
>> str_reverse(str){
>> if(isempty(str)) return str;
>> else if(length(str) = even) then split str into str_1 and str_2; (of
>> equal length)
>>return str_reverse(str_2)+str_reverse(str_1);
>> else split str into str_1, str_2, str_3; //if str is odd length, e.g.
>> len = 7, split by 1-3 | 4 | 5-7
>>   return str_reverse(str_3)+str_2+str_reverse(str_1);
>> }
>>
>> --
>>
>>
>>
>
>  --
>
>
>

-- 




Re: [algogeeks] fastest sequential access

2012-11-23 Thread shady
assume there are no additional insertions, so we care about only accessing
an element.

On Sat, Nov 24, 2012 at 12:30 AM, Pralay Biswas
wrote:

> non synced data structure = not thread safe in most prog languages!
>
> On Fri, Nov 23, 2012 at 9:00 AM, Atul Singh wrote:
>
>> @Pralay.. can u give a more detail about "non synced data structure"
>>
>>  --
>>
>>
>>
>
>  --
>
>
>

-- 




Re: [algogeeks] Openings in Amazon

2012-11-23 Thread shady
no more replies on this thread please.

On Fri, Nov 23, 2012 at 9:29 PM, Vivek Ramamoorthy wrote:

> Hi,
> Amazon is hiring people for software development projects undergoing at
> Blore, Hyd and Chennai divisions.There are openings for Software
> Development Engineer, Software Development Engineer in Test, Application
> Engineer and for Quality Assurance Engineer positions .Send me your resume
> if you are interested.
>
>
>
> --
> *Vivek Ramamoorthy,
> *SDE,
> Amazon,
> Chennai.
>
> --
>
>
>

-- 




[algogeeks] fastest sequential access

2012-11-21 Thread shady
which data structure among the follow has fastest sequential access ?
i)   vector
ii)  Singly linked list
iii) Doubly linked list

it won't be doubly linked list as it involves more pointer manipulations
than singly linked list...

-- 




[algogeeks] Google Facebook Pocket Gems Recruitment Drive

2012-11-20 Thread shady
I was interested in knowing if anyone had the experience of going through
any of the above mentioned companies interviews. What were the questions
asked and the format ?

-- 




[algogeeks] Balanced Partitioning of Subsets

2012-11-20 Thread shady
Hi,
We have to divide a set of numbers into two subsets such that their
difference is minimum (Balanced Partitioning Problem). Can anyone explain
the suggested solution ?
http://ace.delos.com/TESTDATA/JAN11.divgold.htm

-- 




[algogeeks] Problem Complexity

2012-11-20 Thread shady
Is Non-hamiltonian cycle problem not in NP ?
Since to verify it, we need to go through all possible paths which make it
exponential in nature.

Please support your claim with credible links. I found over web that at lot
of places it is written "The Non-hamiltonian cycle problem is not known to
be in NP"

-- 




Re: [algogeeks] Repeating element with constraints

2012-11-19 Thread shady
yes, correct, both solutions are correct, but here there is a chance of
overflow.

On Mon, Nov 19, 2012 at 3:11 PM, shashi kant  wrote:

> @RushirajPatel  if you happen to have looked at the page ..3rd solution is
> the XOR one which is may be a solution for 2 missing numbers
> but the trick can well be used here..
> have a close look there
>
>  --
>
>
>

-- 




[algogeeks] Repeating element with constraints

2012-11-18 Thread shady
Given an array of size n, which has all distinct elements between 1 to n
with one element repeating, which also implies that one element is missing.
How to find the repeating element without using extra space and linear time
complexity ?

Any way to do it with exor ? :P

-- 




Re: [algogeeks] Check if a binary tree is Binary Search Tree or not.

2012-11-18 Thread shady
how come the complexity of Morris Traversal is linear, O(n). Any
explanation ? or some link ?

On Thu, Nov 8, 2012 at 4:34 PM, Kailash Bagaria
wrote:

> If extra space is not allowed to store the inorder traversal then Morris
> Traversal can be used.
> Using Morris Traversal, we can traverse the tree without using stack and
> recursion. The idea of Morris Traversal
> is based on Threaded Binary Tree. In this traversal, we first create links
> to Inorder successor and print the data
> using these links, and finally revert the changes to restore original
> tree.Although the tree is modified through the traversal, it is reverted
> back to its original shape after the completion.
> Unlike Stack based traversal, no extra space is required for this
> traversal.
> Once we are able to traverse the tree in inorder manner then we can easily
> check if it is BST or not.(By checking the non-decreasing behavior)
> For more information on Morris traversal you can visi:
> http://www.geeksforgeeks.org/archives/6358
>
>
> On Wed, Nov 7, 2012 at 10:09 AM, atul anand wrote:
>
>> @vaibhav : by not using extra space...i guess you mean that you were not
>> allowed to use one extra pointer.bcozz space complexity will remain
>> constant for inorder approch.
>>
>> On Tue, Nov 6, 2012 at 1:07 AM, vaibhav shukla 
>> wrote:
>>
>>> yes ofcourse... dats the easiest i suppose...
>>> but in one of my interviews, i told this approach, but was then asked
>>> not to use space (which i was ,to store inorder)
>>> So for such cases, you must try other approaches as well. (DO
>>> inorder,keep track of previously visited node and compare it with current
>>> node for value greater,or less accordingly.)
>>>
>>>
>>> On Tue, Nov 6, 2012 at 12:34 AM, shady  wrote:
>>>
>>>> Hi,
>>>> Can we check this by just doing an inorder traversal, and then checking
>>>> if it is in increasing order or not ?
>>>>
>>>> --
>>>> 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.
>>>>
>>>
>>>
>>>
>>> --
>>> best wishes!!
>>>  Vaibhav
>>>
>>>  --
>>> 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.
>>
>
>
>
> --
>
> --
>
> ‘Kailash Bagaria’
> B-tech 4th year
> Computer Science & Engineering
> Indian Institute of Technology, Roorkee
> Roorkee, India (247667)
>
>  --
> 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: Check if a binary tree is Binary Search Tree or not.

2012-11-05 Thread shady
Understood, thanks.

On Tue, Nov 6, 2012 at 2:35 AM, Don  wrote:

> In English, that is
>
> A null tree is a binary tree.
> Otherwise, it's a binary tree if the root value is greater than the
> left child and less than the right child, and the left and right
> subtrees are binary trees.
>
> Don
>
> On Nov 5, 2:48 pm, Don  wrote:
> > That would work. But a simpler approach is:
> >
> > bool isBinTree(root *t)
> > {
> >return (!t) || ((!t->left || (t->value > t->left->value)) &&
> >(!t->right || (t->value < t->right->value)) &&
> >isBinTree(t->left) && isBinTree(t->right));
> >
> > }
> >
> > On Nov 5, 2:04 pm, shady  wrote:
> >
> >
> >
> >
> >
> >
> >
> > > Hi,
> > > Can we check this by just doing an inorder traversal, and then
> checking if
> > > it is in increasing order or not ?
>
> --
> 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] Check if a binary tree is Binary Search Tree or not.

2012-11-05 Thread shady
Hi,
Can we check this by just doing an inorder traversal, and then checking if
it is in increasing order or not ?

-- 
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] Time Complexity Analysis

2012-11-05 Thread shady
Sorting takes linear time, but it doesnt get repeated n times,

it is like - T(n) = 2*T(n/2) + O(n)

worst case solution is O(n^2)

it is similar to quick sort

On Mon, Nov 5, 2012 at 9:15 PM, rahul sharma wrote:

> dude n for build tree and n in this for finding maximun??so n*(n/2)=o(n^2)
>
> On Mon, Nov 5, 2012 at 8:54 PM, shady  wrote:
>
>> Here the time complexity of the solution should be O(n * log(n))
>> http://www.geeksforgeeks.org/archives/21781
>>
>> --
>> 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.



[algogeeks] Time Complexity Analysis

2012-11-05 Thread shady
Here the time complexity of the solution should be O(n * log(n))
http://www.geeksforgeeks.org/archives/21781

-- 
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: Statistical Tests

2012-10-05 Thread shady
i am talking about t-test, z-test.. which are done when dataset is not
big.. can we avoid them ? When are these tests not required ?

On Fri, Oct 5, 2012 at 8:55 PM, shady  wrote:

> When can we avoid doing statistical significance testing ?
>
>

-- 
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] Statistical Tests

2012-10-05 Thread shady
When can we avoid doing statistical significance testing ?

-- 
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] microsoft_c++_qstn

2012-09-25 Thread shady
this is not a sequence point rule... there is only one way of evaluation
here.
correct me if wrong...

On Tue, Sep 25, 2012 at 11:26 PM, atul anand wrote:

> *i = i + i; // *this  voilate sequence point rule
> output is compiler dependent.
>
>
> On Tue, Sep 25, 2012 at 9:59 PM, Ravi Ranjan wrote:
>
>> @atul
>>
>> so 8 will be the answer or is it not fixed???
>>
>>  --
>> 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.



[algogeeks] Re: [Off topic]Privacy Policies in gmail

2012-08-22 Thread shady
got the answer, they do.

On Wed, Aug 22, 2012 at 7:59 PM, shady  wrote:

> Hi,
> I wanted to know if Google is reading the mails sent by us. Because they
> provide special services to companies when paid with good amounts. Was
> reading on web, that policies have changed and they can read whatever they
> want.
>
> Shady
>

-- 
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] [Off topic]Privacy Policies in gmail

2012-08-22 Thread shady
Hi,
I wanted to know if Google is reading the mails sent by us. Because they
provide special services to companies when paid with good amounts. Was
reading on web, that policies have changed and they can read whatever they
want.

Shady

-- 
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] Interesting Question SPOJ

2012-08-17 Thread shady
you are not supposed to post code. Just post pseudo code to explain logic.

On Fri, Aug 17, 2012 at 12:05 PM, Sairam Ravu  wrote:

> #include 
> #include 
> #include 
>
> using namespace std;
>
> int main()
> {
>  int testcases;
>  cin >> testcases;
>
>  int Inputsize[20];
>  int  *Output[testcases];
>
>  int i;
>
> for(i=0;i  {
> int inputsize=0;
> int *Order;
>cin >> inputsize;
>
>
>
> Order = (int *)malloc(sizeof(int)*(inputsize+1));
>
>int j;
> int value;
> for(j=0;j {
>  cin >> value;
>  Inputsize[j] = value;
>  Order[j] =  j+1;
> }
> Order[j] = '\0';
>
> int temp;
> int tempOrder;
> int tempIndex;
>
>
> for(j=0;j {
>
>  temp = Inputsize[j];
>  tempIndex = j;
>
>  while(temp)
>  {
>
> tempOrder = Order[tempIndex-1];
> Order[tempIndex-1] = Order[tempIndex];
> Order[tempIndex] = tempOrder;
> tempIndex--;
> temp--;
>
>  }
>
> }
>
> //Now have a map between the Order and the index of it
>
> map MapOrder;
> map::iterator  iter;
>
> for(j=0;j {
>  MapOrder[Order[j]] = j+1;
> }
>
>
> for(j=0,iter=MapOrder.begin();iter!=MapOrder.end();iter++,j++)
> Order[j] = iter->second;
>
> Output[i] = Order;
>
>  }
>
>  //Now print the output
>
> int j;
>  for(i=0;i  {
> for(j=0;Output[i][j]!='\0';j++)
> cout< cout< }
>
> }
>
>
> Code is giving correct results- but it is running out of time. Can you
> suggest some way to get out of it?
>
> --
> 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: AMAZON: given col id, print col name in excel

2012-08-16 Thread shady
you can do it easily by counting the number that can be formed with 1 digit
= 26, then 2 digit = 26*26... similarly find the length of the answer and
then can find the number by searching using bsearch over the number of
different characters.

if someone can do it with base % method,, then it is great :-P


On Thu, Aug 16, 2012 at 11:19 PM, Wei.QI  wrote:

> @yq, didn't I ask you this question before?
>
> On Fri, Aug 10, 2012 at 4:48 PM, yq Zhang  wrote:
> > @shiv, your code is correct go compute the base 26 number. However, this
> > question is not base 26 number obviously.
> >
> >
> >
> > On Wed, Aug 8, 2012 at 4:46 AM, shiv narayan 
> > wrote:
> >>
> >> this is similar to conversion of no in base 26.( where digits are
> >> a,b,c,d...z) just think it like decimal to binary conversion here base
> is
> >> instead 26.
> >>
> >> char Carr[26]={a,b,c...z}
> >> i=0;
> >> int arr[];
> >> do
> >> {
> >> arrr[i++]=n%26;
> >> n/=2;
> >> }
> >> while(n) ;
> >> for(int i=n-1;i>=0;i--)
> >> cout< >>
> >> correct me if i am wrong.
> >> On Wednesday, 8 August 2012 12:56:56 UTC+5:30, ashgoel wrote:
> >>>
> >>> Imagine a sequence like this: a, b, c...z, aa, ab, ac...zz, aaa, aab,
> >>> aac aax, aaz, aba, abc... (Its same as excel column names). Given
> an
> >>> integer (n), generate n-th string from the above sequence.
> >>>
> >>>
> >>> Best Regards
> >>> Ashish Goel
> >>> "Think positive and find fuel in failure"
> >>> +919985813081
> >>> +919966006652
> >>
> >> --
> >> 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/-/Z3kYiTZi_F8J.
> >>
> >> 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.



[algogeeks] Interesting Question SPOJ

2012-08-16 Thread shady
One nice question, many of you might have solved it... but still worth
sharing
   Link 

-- 
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 QUESTION

2012-08-16 Thread shady
well we can do with just one array. Overwrite the answer directly on left[]
array.

On Thu, Aug 16, 2012 at 6:47 PM, mohit  wrote:

>
> here are the steps :
> 1) Construct a temporary array left[] such that left[i] contains product
> of all elements on left of A[i] excluding A[i].
> 2) Construct another temporary array right[] such that right[i] contains
> product of all elements on on right of A[i] excluding A[i].
> 3) To get OUT[], multiply left[] and right[].
>
> time complexity : O(n)
>
>
> On Thursday, August 16, 2012 2:26:58 PM UTC+5:30, ram wrote:
>>
>>
>> Hi,
>>
>>This is a microsoft question asked in our campus previous year. 
>> Anyone having idea please share it here...
>>
>>Given an array of n elements A[n]. Write a program to create a new 
>> array OUT[n],
>>
>> which has its elements as multiplication of all the elements in the 
>> input array A[n] except that element (i.e.) OUT[2] = A[0] * A[1] * A[3] * ? 
>> * A[n-1].
>>  Constraint is one should not use division operator.
>>
>>  --
> 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/-/iqyLUMLQRS0J.
>
> 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] MICROSOFT QUESTION

2012-08-16 Thread shady
for n elements, space used - 2n
can we do better ?

On Thu, Aug 16, 2012 at 3:20 PM, atul anand  wrote:

> input :   23   45
> temp1 : 26   24   120
> temp2 : 120  60  20   5
>
> for given input ..take tow temp array.
> temp1[i] = input[0] * input[1] * input[2] * input[3]..input[i]
> temp2[i] = input[i] * input [i + 1] * input[i + 2]input[n];
>
> now out[i] = temp1[i-1] * temp2[i+1];
>
>
> On Thu, Aug 16, 2012 at 2:26 PM, Hariraman R wrote:
>
>>
>> Hi,
>>
>>This is a microsoft question asked in our campus previous year. 
>> Anyone having idea please share it here...
>>
>>Given an array of n elements A[n]. Write a program to create a new 
>> array OUT[n],
>>
>> which has its elements as multiplication of all the elements in the 
>> input array A[n] except that element (i.e.) OUT[2] = A[0] * A[1] * A[3] * ? 
>> * A[n-1].
>>  Constraint is one should not use division operator.
>>
>>  --
>> 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] Codeforces Problem

2012-08-15 Thread shady
understood, thanks a lot everyone

On Wed, Aug 15, 2012 at 2:33 PM, gaurav yadav wrote:

> @aman  +1
>
> --
> 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] Hii

2012-08-14 Thread shady
already answered one day back, present in archives
* EOD **

On Wed, Aug 15, 2012 at 2:38 AM, ragavenderan venkatesan <
ragavende...@gmail.com> wrote:

> Okk
>
> So how can we go about this problem then
>
> Given an array of 32bit unsigned integers in which every number appears
> exactly twice except three of them, find those three numbers in O(n) time
> using O(1) extra space. The input array is read-only. What if there are k
> exceptions instead of 3?
>
>
>
> On Tue, Aug 14, 2012 at 2:07 PM, Arpit Sood  wrote:
>
>> no, because there is more than one possibility.
>>
>>
>> On Wed, Aug 15, 2012 at 2:34 AM, ragavenderan venkatesan <
>> ragavende...@gmail.com> wrote:
>>
>>> for 2 numbers?
>>>
>>>
>>> On Tue, Aug 14, 2012 at 2:00 PM, shady  wrote:
>>>
>>>> not possible.
>>>>
>>>> On Wed, Aug 15, 2012 at 2:26 AM, ragavenderan venkatesan <
>>>> ragavende...@gmail.com> wrote:
>>>>
>>>>> Given Xor of 3 numbers, How can we derive back those 3 numbers?
>>>>> Can any one explain with an example?
>>>>>
>>>>>
>>>>> Thanks
>>>>>
>>>>> Ragavenderan
>>>>>
>>>>> --
>>>>> 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.
>>>
>>
>>
>>
>> --
>> Regards,
>> Arpit Sood
>>
>>  --
>> 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] Re: AMAZON: given col id, print col name in excel

2012-08-14 Thread shady
nope, doesnt work
even taking a simpler case like
a, b, aa, ab, ba, bb, aaa, aab, aba, abb...

using base 2 doesn't give correct results

On Mon, Aug 13, 2012 at 3:33 AM, vivek rungta wrote:

> its base 26 but little modification in code ...
> @shiv - nice solution .
>
> char Carr[26]={a,b,c...z}
> i=0;
> int arr[];
> do
> {
> arrr[i++]=n%26;
> n=(n/26)-1;
> }
> while(n) ;
> for(int i=n-1;i>=0;i--)
> cout<
>
>
> On Sat, Aug 11, 2012 at 9:52 PM, yq Zhang  wrote:
>
>> No. It's not base 26 at all. Given input 26, your code will return ba,
>> but the result should be aa. It's not equivalent to a number.
>>
>>
>> On Sat, Aug 11, 2012 at 2:57 AM, shiv narayan 
>> wrote:
>>
>>> yes actually we have to print a,b,c..z instead of nos , so for that i
>>> have stored nos in character array  so only characters will be printed not
>>> nos
>>>
>>>
>>> On Sat, Aug 11, 2012 at 2:18 AM, yq Zhang wrote:
>>>
 @shiv, your code is correct go compute the base 26 number. However,
 this question is not base 26 number obviously.



 On Wed, Aug 8, 2012 at 4:46 AM, shiv narayan >>> > wrote:

> this is similar to conversion of no in base 26.( where digits are
> a,b,c,d...z) just think it like decimal to binary conversion here base is
> instead 26.
>
> char Carr[26]={a,b,c...z}
> i=0;
> int arr[];
> do
> {
> arrr[i++]=n%26;
> n/=2;
> }
> while(n) ;
> for(int i=n-1;i>=0;i--)
> cout<
> correct me if i am wrong.
> On Wednesday, 8 August 2012 12:56:56 UTC+5:30, ashgoel wrote:
>>
>> Imagine a sequence like this: a, b, c...z, aa, ab, ac...zz, aaa, aab,
>> aac aax, aaz, aba, abc... (Its same as excel column names). Given an
>> integer (n), generate n-th string from the above sequence.
>>
>> Best Regards
>> Ashish Goel
>> "Think positive and find fuel in failure"
>> +919985813081
>> +919966006652
>>
>  --
> 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/-/Z3kYiTZi_F8J.
>
> 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.

>>>
>>>
>>>
>>> --
>>> Shiv Narayan Sharma
>>> Jt. Secretary CSI-DTU
>>> +919971228389
>>> www.jugadengg.com
>>>
>>>
>>>
>>>
>>>  --
>>> 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] Hii

2012-08-14 Thread shady
not possible.

On Wed, Aug 15, 2012 at 2:26 AM, ragavenderan venkatesan <
ragavende...@gmail.com> wrote:

> Given Xor of 3 numbers, How can we derive back those 3 numbers?
> Can any one explain with an example?
>
>
> Thanks
> Ragavenderan
>
> --
> 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] Codeforces Problem

2012-08-14 Thread shady
Hey all,
I fail to understand this problem, can anyone tell what do we need to do ?
Sides of a hexagon is given, but we dont know the tile size.

http://codeforces.com/problemset/problem/216/A

Shady

-- 
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] Constant time solution needed

2012-08-12 Thread shady
@venkat +1

On Sun, Aug 12, 2012 at 9:09 PM, ~*~VICKY~*~ wrote:

> @Arun: This approach is constant time once the array is build for any
> queries that follows. :) You know sum for all possible rectangles in the
> given 2d array thats makes it better than computing sum for each input.
> Hope it makes sense
>
>
> On Sun, Aug 12, 2012 at 9:07 PM, ~*~VICKY~*~ wrote:
>
>> Fine, the basic idea of using dp here is sum of each rectangle is a
>> dependent sub problem. So when u find sum for smaller rectangle we can use
>> it to compute sum of bigger rectangle with new coordinates added to
>> previous small rectangle. So u can compute the sum array by using this
>> formula
>>
>> sum[i][j] = sum[i-1][j-1] + (sum[i-1][j] - sum[i-1][j-1]) + (sum[i][j-1]
>> - sum[i-1][j-1])+ip[i][j]
>> [smaller rect]   [that row sum value][that
>> col sum value]
>>
>>
>>
>> On Sun, Aug 12, 2012 at 8:54 PM, Srividhya Sampath <
>> srisam261...@gmail.com> wrote:
>>
>>> @vicky
>>>
>>> can yo explain the logic behind the 'Sum Array' computation (if possible
>>> elaborately )?
>>>
>>>
>>> On Sun, Aug 12, 2012 at 8:19 PM, ~*~VICKY~*~ wrote:
>>>
 Lets build the array for the example you gave.

 i/p:

 0 1 2 3
 4 5  6 7
 8 9 10 11

 (x1,y1) = (0,0)
 (x2,y2) = (1,2)
 sumArray
 0  1 23
 4  10  18   28
 12 27  45  66
 (will take O(n^2) to build above array)
 So now when you get coordinates as input, you can calc the sum by

 Ans = sumArray[x2][y2] - sumArray[x1][y1] + ip[x1][y1]

 For our case it will be Ans = 18-0+0 = 18

 Please lemme know if any bugs with the logic.


 On Sun, Aug 12, 2012 at 6:27 PM, Srividhya Sampath <
 srisam261...@gmail.com> wrote:

>
> @ Vicky
>
> Can yo explain with an illustration ?
>
>
> On Sat, Aug 11, 2012 at 10:07 PM, ~*~VICKY~*~  > wrote:
>
>> May be you can consider creating a 2d array to pre process and store
>> all the rectangle sums as a dependent subproblem, the sum of larger rect
>> will be currValuesAdded+OldRectSum. So when you get the coordinate as 
>> input
>> u can calc the needed sum by subtracting sum of big rect and small rect
>> which is not included in the given coordinates. This can be called 
>> constant
>> time if u don't include the preprocessing time.
>>
>>
>> On Sat, Aug 11, 2012 at 9:57 PM, adarsh kumar wrote:
>>
>>> Sum of the integers meaning? Do you mind giving an example test case?
>>>
>>> regards.
>>>
>>> On Sat, Aug 11, 2012 at 7:10 PM, Srividhya 
>>> wrote:
>>>
 hi all:)

 The coordinates of a rectangle will be specified. there is a matrix
 of integers. yo should find the sum of the integers that fall in the 
 region
 specified by the  coordinates .

 The solution to be in constant time .

 --
 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/-/qHSmXBshmS4J.
 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.
>>>
>>
>>
>>
>> --
>> Cheers,
>>
>>   Vicky
>>
>>  --
>> 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.
>



 --
 Cheers,

   Vicky

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

Re: [algogeeks] Constant time solution needed

2012-08-12 Thread shady
a small question, if matrix has 'r' rows and 'c' columns, how many
different rectangles can be there for this problem ?
Space Complexity = O( (r*r)*(c*c) )

On Sat, Aug 11, 2012 at 7:10 PM, Srividhya  wrote:

> hi all:)
>
> The coordinates of a rectangle will be specified. there is a matrix of
> integers. yo should find the sum of the integers that fall in the region
> specified by the  coordinates .
>
> The solution to be in constant time .
>
> --
> 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/-/qHSmXBshmS4J.
> 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] Local Minima in Unsorted Array

2012-08-03 Thread shady
Hi,
Can anyone tell how to find local minima in an unsorted array ? Recommended
solution : O(log(n))

Shady.

-- 
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] eight queens on lisp

2012-06-29 Thread shady
even i dont know how to code in LISP, but this might help
http://obereed.net/queens/algorithm.html

On Fri, Jun 29, 2012 at 5:45 AM, Victor Manuel Grijalva Altamirano <
kavic1.mar...@gmail.com> wrote:

> Hi i need your help, i need to programm the problem "eight queens" in LISP.
> I´m learning LISP, but i´m new...
> Anybody can help me?
> I have the idea of backtracking,  but i don´t know how to code it in
> LISP...
>
> --
> Victor Manuel Grijalva Altamirano
> Universidad Tecnologica de La Mixteca
>
> --
> 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] Microsoft interview qs

2012-06-29 Thread shady
i am not sure if it is possible to change the length of an already declared
array, so i think one might wanna use pointers instead. Allocate memory
dynamically.

On Thu, Jun 28, 2012 at 2:36 PM, deepikaanand wrote:

> //Taken from careercup.com
>
> Design the autocomplete feature (ex:Google Suggest)
>
> I assumed {"abcde","abcegh","abcpqr","abcxyz","xyz" ,"abcmno"} URLs
> and stored them in trie...Such if the user enters abc ...the o/p will
> be
>
> abc is a prefix in 5 number of cases
>  d e
>  e g h
>  m n o
>  p q r
>  x y z
>
>
> Now say if I add more strings of the form abcdpqr,"abcdprst"..How can
> I modify this code such that now thw o/p is
>
>  d e
>  e g h
>  m n o
>  p q r
>  x y z
>  d p q r
>  d p r s t
>
> code in c :-
> http://ideone.com/rBvQb
>
> --
> 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] 4Sum

2012-06-24 Thread shady
@hemesh, amol = correct solutions

ABCDEF another problem on SPOJ, incase people want to try.

On Sun, Jun 24, 2012 at 2:13 AM, Sourabh Singh wrote:

> @ Amol Sharma
>
> thanx got it..
>
> yup, overlooked those case's :-) my bad..
>
>
> On Sat, Jun 23, 2012 at 1:31 PM, Amol Sharma wrote:
>
>> @sourabh:
>> for this particular question..
>> in your code replace
>>
>> if(binary_search(c,c+size,-b[i]))
>> count++;
>>
>> by
>>
>> count+=upper_bound(c,c+size,-b[i])-lower_bound(c,c+size,-b[i]);
>>
>> you are actually missing some of the quadruplesas there can be more
>> than one element with value -b[i] in the array c and you are actually
>> ignoring them.
>>  --
>>
>>
>> Amol Sharma
>> Final Year Student
>> Computer Science and Engineering
>> MNNIT Allahabad
>>
>>  
>> 
>>
>>
>>
>>
>>
>>
>> On Sun, Jun 24, 2012 at 1:22 AM, Sourabh Singh 
>> wrote:
>>
>>> @ALL
>>>
>>>  O(n^2 lg(n^2))
>>>
>>> http://www.spoj.pl/problems/SUMFOUR/
>>>
>>> my code :
>>> http://ideone.com/kAPNB
>>>
>>> plz. suggest some test case's :
>>>
>>> On Sat, Jun 23, 2012 at 6:59 AM, Amol Sharma wrote:
>>>
 @bhaskar,rammar:

 I don't think your algo willn not work for the following test case --


 test case :
 arr: 2 4 6 8
 arr^2 : 6 8 10 10 12 14(sum of each unique pair in
 arr[i])

 let's say target sum is 26

 your solution will return true as they 12+14=26 but in 12 and 14, 8 is
 common, infact 26  is not possible in the given array

 --


 Amol Sharma
 Final Year Student
 Computer Science and Engineering
 MNNIT Allahabad

  
 






 On Fri, Jun 22, 2012 at 11:45 PM, Bhaskar Kushwaha <
 bhaskar.kushwaha2...@gmail.com> wrote:

> We first compute the N^2 two sums, and sort the two sums. The for each
> TwoSum t, we check whether there is another two sum t' such that t.value +
> t'.value = target. The time complexity of this approach is O(N^2 logN)
>
>
> On Wed, Jun 20, 2012 at 1:36 AM, rammar  wrote:
>
>> Lets see ur example... We can have two other arrays corresponding to
>> our n^2 array.
>> For every (target-arr[i]) which we search in our look up array, we
>> can also search the components which were used to get that sum. This can 
>> be
>> done in addition constant amount search.
>> I hope we can still go with Hemesh's algo. Please let me know if it
>> breaks somewhere...
>>
>> let's take a test case :
>> arr: 2   4   68
>> arr[0]: 6   8   10   10   12   14
>> arr[1]: 2   22 4 46
>> arr[2]: 4   68 6 88
>>
>>
>> P.S. Can we do better?
>>
>> On Wednesday, June 20, 2012 12:22:52 AM UTC+5:30, Amol Sharma wrote:
>>>
>>> @rammar:
>>> can you please explain the case...which i took in the earlier
>>> post..with this method.
>>>
>>> --
>>>
>>>
>>> Amol Sharma
>>> Final Year Student
>>> Computer Science and Engineering
>>> MNNIT Allahabad
>>>
>>>  
>>> 
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Tue, Jun 19, 2012 at 11:27 PM, rammar  wrote:
>>>
 @Hemesh +1

   Please correct me if i am wrong.
   Creation of our look up array a[n*n] -> sum of all the pairs will
 take O(n^2).
   Search using binary sort or quick sort in O(n^2 log (n^2) )  ==
 O(n^2 log n)
   We will traverse this array, and for every element we will find
 (target - a[i])  -> This traversal will again take O(n^2).
   For every (target -a[i]) we will search it in our
 lookup array using binary search -> This will take O(log n^2) = O(2log 
 n) =
 O(log n)
   We will store all the matched for the target.

 Final complexity = O(n^2) + O(n^2 log n) + O(n^2)*O(log n)   == O
 (n^2 log n)
   If the values of max of a[n] is not very high, we can go with a
 hash map. This will result in a quick look up. And we can get the 
 answer in
 O(n^2).


 P.S. Can we do better?


 On Monday, June 18, 2012 6:10:33 PM UTC+5:30, Jalaj wrote:
>
> @KK and hemesh
> target is not a constant value , it can be any element

Re: [algogeeks] spoj problem EASYMATH

2012-06-24 Thread shady
dont post codes, ask whether your algorithm is correct or not.

On Sun, Jun 24, 2012 at 8:29 PM, Hassan Monfared wrote:

> use " return (a/gcd(a,b)*b instead "
>
>
> On Sun, Jun 24, 2012 at 7:10 PM, Sourabh Singh 
> wrote:
>
>> please suggest something  :
>>
>> Problem :
>> http://www.spoj.pl/problems/EASYMATH/
>>
>> C++ code :
>> http://ideone.com/r2OSb
>> was getting wrong ans due to over flow i think in LCM() for big prime's i
>> guess.
>> thin tried in python .
>>
>> Now getting NZEC for python code which mean's high level or recurrsion
>> some where preventing
>> normal termination .
>> but where ??
>>
>> Python code:
>> http://ideone.com/KDPPJ
>>
>> --
>> 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] Re: dp problem

2012-04-14 Thread shady
http://groups.google.com/group/algogeeks/browse_thread/thread/c678b320891bbaa1/1646f2fe7d2c6879?hl=en&lnk=gst&q=Spoj+Domino+Tiling+#1646f2fe7d2c6879


by traditional i mean, by dividing it into similar structure to make
recurrence come into picture.

@kunal any updates on the same ?

On Fri, Apr 13, 2012 at 4:57 PM, UTKARSH SRIVASTAV
wrote:

> anyone ?
>
> On Fri, Apr 13, 2012 at 12:09 PM, UTKARSH SRIVASTAV <
> usrivastav...@gmail.com> wrote:
>
>> how to solve these type of problems  http://www.spoj.pl/problems/GNY07H/
>>   means how to approach this problem by dp.
>>
>> --
>> *UTKARSH SRIVASTAV
>> CSE-3
>> B-Tech 3rd Year
>> @MNNIT ALLAHABAD*
>>
>>
>>
>
>
> --
> *UTKARSH SRIVASTAV
> CSE-3
> B-Tech 3rd Year
> @MNNIT ALLAHABAD*
>
>
>  --
> 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: [Directi] Two most distant element in tree

2012-03-26 Thread shady
@arunachalam you have misunderstood the problem.


On Tue, Mar 27, 2012 at 8:10 AM, Arunachalam wrote:

> This algorithm is almost right, but not exactly correct.
>
> Say for example you have a binary tree like this
>
>1
>  2
>3  4
> 5   6
>
> The length of the longest path is 4, and this algorithm would return 5.
> The algorithm can be slightly modified to find the max path.
>
> Hint: recursively find out the max path for every node assuming it as root
> and you will have a solution.
>
> Thanks,
> Arun.
>
>
>
> On Mon, Mar 26, 2012 at 6:48 AM, Don  wrote:
>
>> If the longest path passes through the root of the tree, then the
>> length of the path is the depth of the left subtree plus the depth of
>> the right subtree. If the longest path does not pass through the root,
>> then it is the max of the longest path in the left subtree or the
>> right subtree.
>>
>> int longestPath(node *root, int *depth=0)
>> {
>>  if (root)
>>  {
>>int depthLeft, depthRight;
>>int leftResult = longestPath(root->left, &depthLeft);
>>int rightResult = longestPath(root->right, &depthRight);
>>if (depth) *depth = 1 + max(depthLeft, depthRight);
>>return max(leftResult, rightResult, depthLeft+depthRight);
>>  }
>>  else
>>  {
>>if (depth) *depth = 0;
>>return 0;
>>  }
>> }
>>
>> On Mar 25, 12:37 pm, karthikeyan muthu 
>> wrote:
>> > the path we are looking for is surely between two leaf nodes.
>> >
>> > start from the root and go to the deepest leaf node.. (dfs/bfs)
>> >
>> > from that node traverse the entire tree to find the longest path that
>> > exists (dfs/bfs)
>> >
>> > u can keep track of the last node u visit in two variables for every
>> path
>> > and update new variables with the optimal path's last visited node ..
>> >
>> > this way u get the two required nodes
>> >
>> >
>> >
>> > On Sun, Mar 25, 2012 at 3:40 PM, Navin Kumar 
>> wrote:
>> > > How to find the two most distant nodes in a binary tree.
>> > > Its not about calculating the diameter of  tree, but the two end
>> nodes in
>> > > the diameter of the tree.
>> > > Optimal algorithm expected ..
>> >
>> > > --
>> > > 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/-/8pDy6hcBPOUJ.
>> > > 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.- Hide quoted text -
>> >
>> > - Show quoted text -
>>
>> --
>> 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] Re: POW function in C++/C

2012-03-26 Thread shady
@don it is, actually i wanted to give a smaller example so wrote like that.

@arpit thanks, powl() solved the problem.

On Mon, Mar 26, 2012 at 7:00 PM, Don  wrote:

> Why use pow to compute a square when * is significantly faster?
> Don
>
> On Mar 26, 6:09 am, shady  wrote:
> > Hi,
> >  i am using pow() function in C++ to calculate square of 99937, but
> to
> > my amazement it is giving one less than actual value. Since it returns
> > double, i am adding 10e-5 to get the correct value, but still no
> > improvement. Any idea ?
>
> --
> 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] POW function in C++/C

2012-03-26 Thread shady
Hi,
 i am using pow() function in C++ to calculate square of 99937, but to
my amazement it is giving one less than actual value. Since it returns
double, i am adding 10e-5 to get the correct value, but still no
improvement. Any idea ?

-- 
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] [Directi] Two most distant element in tree

2012-03-26 Thread shady
bfs/dfs will work but will be complex.

First do a BFS from root node, and reach a corner(leaf node). This node
will always be the part of solution, so you will do another BFS from this
leaf node. For this you need to store for every node their parent and child
pointers.

@lucifier +1

On Sun, Mar 25, 2012 at 11:07 PM, karthikeyan muthu <
keyankarthi1...@gmail.com> wrote:

> the path we are looking for is surely between two leaf nodes.
>
> start from the root and go to the deepest leaf node.. (dfs/bfs)
>
> from that node traverse the entire tree to find the longest path that
> exists (dfs/bfs)
>
> u can keep track of the last node u visit in two variables for every path
> and update new variables with the optimal path's last visited node ..
>
> this way u get the two required nodes
>
>
> On Sun, Mar 25, 2012 at 3:40 PM, Navin Kumar wrote:
>
>> How to find the two most distant nodes in a binary tree.
>> Its not about calculating the diameter of  tree, but the two end nodes in
>> the diameter of the tree.
>> Optimal algorithm expected ..
>>
>> --
>> 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/-/8pDy6hcBPOUJ.
>> 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] Re: Interview question

2012-03-25 Thread shady
@gene
i think for  3 4 2 you need to start from left most element, and then make
substitutions one by one.
so it will be
3 4 2
2 4 3
2 3 4


@all i googled a bit, and found that O(n) solution is possible for it, any
idea ?

On Sun, Mar 25, 2012 at 1:59 PM, Kartik Sachan wrote:

> +1 @saurabh...:P
>
> --
> 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] [ DirectI ] Interview question

2012-03-24 Thread shady
what is the output for this ?
 { 1 ,6 ,8 ,3 ,5, 4, 2}

On Sat, Mar 24, 2012 at 7:31 PM, Navin Kumar  wrote:

> Given an array of integers, for each index i, you have to swap the value
> at i with the first value smaller than A[ i ] that comes after index i.
> An efficient solution expected.
>
>  --
> 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/-/an6YzWV-2xsJ.
> 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: Check if one tree is sub tree of other

2012-03-21 Thread shady
seems correct with pre-order traversal if not give some example

On Wed, Mar 21, 2012 at 10:32 AM, Mahesh Thakur wrote:

> First Tree:
> 1
>   2 3
>  4  5   67
>
> Inorder traverse will be : 4251637
>
> Second Tree:
>   6
>1 3
>
> Inorder traversal is 163.
>
> But they second tree is not subset. let me know if i got the question
> wrong.
>
> On Wed, Mar 21, 2012 at 10:27 AM, shady  wrote:
>
>> @Sid +100
>>
>>
>> On Wed, Mar 21, 2012 at 10:20 AM, siddharam suresh <
>> siddharam@gmail.com> wrote:
>>
>>> get the inorder traversal both tree (into strings) check weather one
>>> string substring of other if yes then one tree is sub tree of other.
>>>
>>>
>>> Thank you,
>>> Sid.
>>> phone:+91-8971070727,
>>> +91-9916809982
>>>
>>>
>>>
>>> On Wed, Mar 21, 2012 at 9:23 AM, HARSHIT PAHUJA >> > wrote:
>>>
>>>> bool isSubtree(Tree * A,Tree *B)
>>>> {
>>>>
>>>> if(!B) return true;
>>>> if(!A)return false;
>>>> if(A->data==B->data)
>>>>return (isSubtree(A->left,B->left)
>>>> && isSubtree(A->right,B->right));
>>>> else
>>>>  return (isSubtree(A->left,B) && isSubtree(A->right,B));
>>>> }
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> }
>>>>
>>>> On Wed, Mar 21, 2012 at 2:33 AM, Don  wrote:
>>>>
>>>>> bool equals(node *t1, node *t2)
>>>>> {
>>>>>  return (t1 && t2) ? (t1->value == t2->value) && equals(t1->left, t2-
>>>>> >left) && equals(t1->right, t2->right) : !t1 && !t2;
>>>>> }
>>>>>
>>>>> bool check(node *t1, node *subtree)
>>>>> {
>>>>>  return t1 ? equals(t1, subtree) || check(t1->left, subtree) ||
>>>>> check(t1->right, subtree) : !subtree;
>>>>> }
>>>>>
>>>>> On average this is the same as a traversal, but worst case could be
>>>>> very slow. Imagine a large tree with millions of nodes, where all the
>>>>> nodes = 1, and a somewhat smaller subtree with 100,000 nodes=1 and one
>>>>> node at the far right of the tree = 2. It would require a lengthy
>>>>> comparision at each node which would ultimately find no matching sub
>>>>> tree.
>>>>>
>>>>> If they are binary search trees, it could be more efficient. Did you
>>>>> mean to ask about binary search trees?
>>>>>
>>>>> Don
>>>>>
>>>>> On Mar 20, 7:24 am, Dheeraj Sharma 
>>>>> wrote:
>>>>> > How to check if one binary tree is a sub tree of other?
>>>>> > Any Solution other then bruteforce?
>>>>> > Prototype
>>>>> > bool check(node *t1,node *subtree)
>>>>> >
>>>>> > --
>>>>> > Sent from my mobile device
>>>>> >
>>>>> > *Dheeraj Sharma*
>>>>>
>>>>> --
>>>>> 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.
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> HARSHIT PAHUJA
>>>> M.N.N.I.T.
>>>> ALLAHABAD
>>>>
>>>>
>>>>  --
>>>> 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] Re: Check if one tree is sub tree of other

2012-03-20 Thread shady
@Sid +100

On Wed, Mar 21, 2012 at 10:20 AM, siddharam suresh
wrote:

> get the inorder traversal both tree (into strings) check weather one
> string substring of other if yes then one tree is sub tree of other.
>
>
> Thank you,
> Sid.
> phone:+91-8971070727,
> +91-9916809982
>
>
>
> On Wed, Mar 21, 2012 at 9:23 AM, HARSHIT PAHUJA 
> wrote:
>
>> bool isSubtree(Tree * A,Tree *B)
>> {
>>
>> if(!B) return true;
>> if(!A)return false;
>> if(A->data==B->data)
>>return (isSubtree(A->left,B->left)
>> && isSubtree(A->right,B->right));
>> else
>>  return (isSubtree(A->left,B) && isSubtree(A->right,B));
>> }
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> }
>>
>> On Wed, Mar 21, 2012 at 2:33 AM, Don  wrote:
>>
>>> bool equals(node *t1, node *t2)
>>> {
>>>  return (t1 && t2) ? (t1->value == t2->value) && equals(t1->left, t2-
>>> >left) && equals(t1->right, t2->right) : !t1 && !t2;
>>> }
>>>
>>> bool check(node *t1, node *subtree)
>>> {
>>>  return t1 ? equals(t1, subtree) || check(t1->left, subtree) ||
>>> check(t1->right, subtree) : !subtree;
>>> }
>>>
>>> On average this is the same as a traversal, but worst case could be
>>> very slow. Imagine a large tree with millions of nodes, where all the
>>> nodes = 1, and a somewhat smaller subtree with 100,000 nodes=1 and one
>>> node at the far right of the tree = 2. It would require a lengthy
>>> comparision at each node which would ultimately find no matching sub
>>> tree.
>>>
>>> If they are binary search trees, it could be more efficient. Did you
>>> mean to ask about binary search trees?
>>>
>>> Don
>>>
>>> On Mar 20, 7:24 am, Dheeraj Sharma 
>>> wrote:
>>> > How to check if one binary tree is a sub tree of other?
>>> > Any Solution other then bruteforce?
>>> > Prototype
>>> > bool check(node *t1,node *subtree)
>>> >
>>> > --
>>> > Sent from my mobile device
>>> >
>>> > *Dheeraj Sharma*
>>>
>>> --
>>> 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.
>>>
>>>
>>
>>
>> --
>> HARSHIT PAHUJA
>> M.N.N.I.T.
>> ALLAHABAD
>>
>>
>>  --
>> 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] Vertical Sum in a given Binary Tree

2012-03-20 Thread shady
yes, that's what he wrote in the definition of vertical sum as  well.

On Tue, Mar 20, 2012 at 10:24 PM, rahul sharma wrote:

> we have to include every node??if distance for two or more nodes is same
> they are summed???m i ryt???i doubt
>
>
> On Mon, Mar 19, 2012 at 9:36 PM, shady  wrote:
>
>> oops no 2 there
>>
>>
>> On Mon, Mar 19, 2012 at 9:36 PM, shady  wrote:
>>
>>> if tree is like
>>>
>>> 1 / \ 2 3 / \ / \ 4 5 6 7
>>> / \
>>>  12 -8
>>>
>>> then vertical sums are
>>>
>>> 12(1 + 5 + 6)
>>> 2
>>> 4
>>> -6(2+-8)
>>> 3
>>> 7
>>> 12
>>>
>>>
>>>
>>> On Mon, Mar 19, 2012 at 9:05 PM, rahul sharma 
>>> wrote:
>>>
>>>> @supraja ..can u give example..code not needed..
>>>>
>>>> @all..plz post me example.i dnt know what is vertical sum..i wana know
>>>> only that..thnx...
>>>>
>>>> On Mon, Mar 19, 2012 at 7:31 PM, shady  wrote:
>>>>
>>>>> anything that can help people learn is always allowed. :)
>>>>>
>>>>>
>>>>> On Sun, Mar 18, 2012 at 6:38 PM, Supraja Jayakumar <
>>>>> suprajasank...@gmail.com> wrote:
>>>>>
>>>>>> Hi
>>>>>> Others are also welcome to comment on the code. If links are allowed
>>>>>> in algogeeks, I might send my wordpress blog link that explains this
>>>>>> problem in detail and in picture.
>>>>>>
>>>>>> BinaryTree* VerticalSum(BinaryTree *bt) {
>>>>>> if(!bt) return;
>>>>>> BinaryTree *left = bt->left;
>>>>>> BinaryTree *right = bt->right;
>>>>>> bt->VerticalSumValue += right(left)->value+left(right)->value;
>>>>>> VerticalSum(left);
>>>>>> VerticalSum(right);
>>>>>> }
>>>>>>
>>>>>> BinaryTree* right(BinaryTree *left) {
>>>>>> if(!left) return;
>>>>>> sum+=right(left->right);
>>>>>> return sum;
>>>>>> }
>>>>>>
>>>>>> BinaryTree *left(BinaryTree *right) {
>>>>>> if(!right) return;
>>>>>> sum+=left(right->left);
>>>>>> return sum;
>>>>>> }
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> Supraja J
>>>>>>
>>>>>>
>>>>>> On Sun, Mar 18, 2012 at 5:50 AM, rahul sharma <
>>>>>> rahul23111...@gmail.com> wrote:
>>>>>>
>>>>>>> plz some one explain...i hav read online but getting the code and
>>>>>>> same explanaiton...need it urgent...thnx in advance
>>>>>>>
>>>>>>>
>>>>>>> On Sun, Mar 18, 2012 at 12:38 AM, rahul sharma <
>>>>>>> rahul23111...@gmail.com> wrote:
>>>>>>>
>>>>>>>> @anna..plz elaborate more...
>>>>>>>>
>>>>>>>>
>>>>>>>> On Sun, Mar 18, 2012 at 12:26 AM, Supraja Jayakumar <
>>>>>>>> suprajasank...@gmail.com> wrote:
>>>>>>>>
>>>>>>>>> Hi
>>>>>>>>>
>>>>>>>>> I think its the sum of all the right children of the left subtree
>>>>>>>>> and left children of the right subtree. (Note: this does NOT apply
>>>>>>>>> recursively)
>>>>>>>>>
>>>>>>>>> Thanks
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Sat, Mar 17, 2012 at 9:31 AM, rahul sharma <
>>>>>>>>> rahul23111...@gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> plz explain...i m nt able to get the concept.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Sat, Mar 17, 2012 at 8:50 PM, rahul sharma <
>>>>>>>>>> rahul23111...@gmail.com> wrote:
>>>>>>>>>>
>>>>>>>>>>> how come 2,3,7 in vertical sum?
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>

Re: [algogeeks] Check if one tree is sub tree of other

2012-03-20 Thread shady
5
/\
3  4

is this subtree of

1
  / \
34
  /   \
 51
/  \
   34
 /
9
?

On Tue, Mar 20, 2012 at 5:54 PM, Dheeraj Sharma  wrote:

> How to check if one binary tree is a sub tree of other?
> Any Solution other then bruteforce?
> Prototype
> bool check(node *t1,node *subtree)
>
> --
> Sent from my mobile device
>
> *Dheeraj Sharma*
>
> --
> 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] Run Length Decoding... inplace

2012-03-19 Thread shady
keep a pointer and just write the count with the corresponding character on
the same character array.

On Mon, Mar 19, 2012 at 10:38 PM, ATul SIngh wrote:

> This was a MS question asked recently on Run length Decoding. I was
> given
> Input- a3b5c3d2
>
> And the output should be  ddcccbaaa
>
> Assuming that the memory given is sufficient to accomodate the whole
> string.
> And this conversion should be inplace. ie the output string should not
> use another array.
>
> --
> 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] Vertical Sum in a given Binary Tree

2012-03-19 Thread shady
oops no 2 there

On Mon, Mar 19, 2012 at 9:36 PM, shady  wrote:

> if tree is like
>
> 1 / \ 2 3 / \ / \ 4 5 6 7
> / \
>  12 -8
>
> then vertical sums are
>
> 12(1 + 5 + 6)
> 2
> 4
> -6(2+-8)
> 3
> 7
> 12
>
>
>
> On Mon, Mar 19, 2012 at 9:05 PM, rahul sharma wrote:
>
>> @supraja ..can u give example..code not needed..
>>
>> @all..plz post me example.i dnt know what is vertical sum..i wana know
>> only that..thnx...
>>
>> On Mon, Mar 19, 2012 at 7:31 PM, shady  wrote:
>>
>>> anything that can help people learn is always allowed. :)
>>>
>>>
>>> On Sun, Mar 18, 2012 at 6:38 PM, Supraja Jayakumar <
>>> suprajasank...@gmail.com> wrote:
>>>
>>>> Hi
>>>> Others are also welcome to comment on the code. If links are allowed in
>>>> algogeeks, I might send my wordpress blog link that explains this problem
>>>> in detail and in picture.
>>>>
>>>> BinaryTree* VerticalSum(BinaryTree *bt) {
>>>> if(!bt) return;
>>>> BinaryTree *left = bt->left;
>>>> BinaryTree *right = bt->right;
>>>> bt->VerticalSumValue += right(left)->value+left(right)->value;
>>>> VerticalSum(left);
>>>> VerticalSum(right);
>>>> }
>>>>
>>>> BinaryTree* right(BinaryTree *left) {
>>>> if(!left) return;
>>>> sum+=right(left->right);
>>>> return sum;
>>>> }
>>>>
>>>> BinaryTree *left(BinaryTree *right) {
>>>> if(!right) return;
>>>> sum+=left(right->left);
>>>> return sum;
>>>> }
>>>>
>>>> Thanks
>>>>
>>>> Supraja J
>>>>
>>>>
>>>> On Sun, Mar 18, 2012 at 5:50 AM, rahul sharma 
>>>> wrote:
>>>>
>>>>> plz some one explain...i hav read online but getting the code and same
>>>>> explanaiton...need it urgent...thnx in advance
>>>>>
>>>>>
>>>>> On Sun, Mar 18, 2012 at 12:38 AM, rahul sharma <
>>>>> rahul23111...@gmail.com> wrote:
>>>>>
>>>>>> @anna..plz elaborate more...
>>>>>>
>>>>>>
>>>>>> On Sun, Mar 18, 2012 at 12:26 AM, Supraja Jayakumar <
>>>>>> suprajasank...@gmail.com> wrote:
>>>>>>
>>>>>>> Hi
>>>>>>>
>>>>>>> I think its the sum of all the right children of the left subtree
>>>>>>> and left children of the right subtree. (Note: this does NOT apply
>>>>>>> recursively)
>>>>>>>
>>>>>>> Thanks
>>>>>>>
>>>>>>>
>>>>>>> On Sat, Mar 17, 2012 at 9:31 AM, rahul sharma <
>>>>>>> rahul23111...@gmail.com> wrote:
>>>>>>>
>>>>>>>> plz explain...i m nt able to get the concept.
>>>>>>>>
>>>>>>>>
>>>>>>>> On Sat, Mar 17, 2012 at 8:50 PM, rahul sharma <
>>>>>>>> rahul23111...@gmail.com> wrote:
>>>>>>>>
>>>>>>>>> how come 2,3,7 in vertical sum?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Sat, Mar 17, 2012 at 3:48 PM, prashant thorat <
>>>>>>>>> prashantnit...@gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> First , Do recursive traverse from root node and assign vertical
>>>>>>>>>> level for each node. like this,
>>>>>>>>>> for root node level = 0 , root->left level = -1 ,
>>>>>>>>>> root->left->right = 0 , root->left->left = -2, like this
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> so below tree becomes,
>>>>>>>>>>
>>>>>>>>>>   1(0)
>>>>>>>>>>/\
>>>>>>>>>> 2(-1)3(1)
>>>>>>>>>>  /  \   /\
>>>>>>>>>> 4(-2)   5(0)  6(1)   7(2)
>>>>>>>>>>
>>>>>>>>>>
>>>>&

Re: [algogeeks] Vertical Sum in a given Binary Tree

2012-03-19 Thread shady
if tree is like

1 / \ 2 3 / \ / \ 4 5 6 7
/ \
12 -8

then vertical sums are

12(1 + 5 + 6)
2
4
-6(2+-8)
3
7
12



On Mon, Mar 19, 2012 at 9:05 PM, rahul sharma wrote:

> @supraja ..can u give example..code not needed..
>
> @all..plz post me example.i dnt know what is vertical sum..i wana know
> only that..thnx...
>
> On Mon, Mar 19, 2012 at 7:31 PM, shady  wrote:
>
>> anything that can help people learn is always allowed. :)
>>
>>
>> On Sun, Mar 18, 2012 at 6:38 PM, Supraja Jayakumar <
>> suprajasank...@gmail.com> wrote:
>>
>>> Hi
>>> Others are also welcome to comment on the code. If links are allowed in
>>> algogeeks, I might send my wordpress blog link that explains this problem
>>> in detail and in picture.
>>>
>>> BinaryTree* VerticalSum(BinaryTree *bt) {
>>> if(!bt) return;
>>> BinaryTree *left = bt->left;
>>> BinaryTree *right = bt->right;
>>> bt->VerticalSumValue += right(left)->value+left(right)->value;
>>> VerticalSum(left);
>>> VerticalSum(right);
>>> }
>>>
>>> BinaryTree* right(BinaryTree *left) {
>>> if(!left) return;
>>> sum+=right(left->right);
>>> return sum;
>>> }
>>>
>>> BinaryTree *left(BinaryTree *right) {
>>> if(!right) return;
>>> sum+=left(right->left);
>>> return sum;
>>> }
>>>
>>> Thanks
>>>
>>> Supraja J
>>>
>>>
>>> On Sun, Mar 18, 2012 at 5:50 AM, rahul sharma 
>>> wrote:
>>>
>>>> plz some one explain...i hav read online but getting the code and same
>>>> explanaiton...need it urgent...thnx in advance
>>>>
>>>>
>>>> On Sun, Mar 18, 2012 at 12:38 AM, rahul sharma >>> > wrote:
>>>>
>>>>> @anna..plz elaborate more...
>>>>>
>>>>>
>>>>> On Sun, Mar 18, 2012 at 12:26 AM, Supraja Jayakumar <
>>>>> suprajasank...@gmail.com> wrote:
>>>>>
>>>>>> Hi
>>>>>>
>>>>>> I think its the sum of all the right children of the left subtree and
>>>>>> left children of the right subtree. (Note: this does NOT apply 
>>>>>> recursively)
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>>
>>>>>> On Sat, Mar 17, 2012 at 9:31 AM, rahul sharma <
>>>>>> rahul23111...@gmail.com> wrote:
>>>>>>
>>>>>>> plz explain...i m nt able to get the concept.
>>>>>>>
>>>>>>>
>>>>>>> On Sat, Mar 17, 2012 at 8:50 PM, rahul sharma <
>>>>>>> rahul23111...@gmail.com> wrote:
>>>>>>>
>>>>>>>> how come 2,3,7 in vertical sum?
>>>>>>>>
>>>>>>>>
>>>>>>>> On Sat, Mar 17, 2012 at 3:48 PM, prashant thorat <
>>>>>>>> prashantnit...@gmail.com> wrote:
>>>>>>>>
>>>>>>>>> First , Do recursive traverse from root node and assign vertical
>>>>>>>>> level for each node. like this,
>>>>>>>>> for root node level = 0 , root->left level = -1 ,
>>>>>>>>> root->left->right = 0 , root->left->left = -2, like this
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> so below tree becomes,
>>>>>>>>>
>>>>>>>>>   1(0)
>>>>>>>>>/\
>>>>>>>>> 2(-1)3(1)
>>>>>>>>>  /  \   /\
>>>>>>>>> 4(-2)   5(0)  6(1)   7(2)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> After this again, take an array to store sum initialize to 0, and
>>>>>>>>> traverse tree again , while traversing store the value of that node 
>>>>>>>>> in it's
>>>>>>>>> level.
>>>>>>>>>
>>>>>>>>> This way u'll be able to calculate vertical sum.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Thanks
>>>>>>>>>
>>>>>>>>> On Sat, Mar 

Re: [algogeeks] Vertical Sum in a given Binary Tree

2012-03-19 Thread shady
anything that can help people learn is always allowed. :)

On Sun, Mar 18, 2012 at 6:38 PM, Supraja Jayakumar  wrote:

> Hi
> Others are also welcome to comment on the code. If links are allowed in
> algogeeks, I might send my wordpress blog link that explains this problem
> in detail and in picture.
>
> BinaryTree* VerticalSum(BinaryTree *bt) {
> if(!bt) return;
> BinaryTree *left = bt->left;
> BinaryTree *right = bt->right;
> bt->VerticalSumValue += right(left)->value+left(right)->value;
> VerticalSum(left);
> VerticalSum(right);
> }
>
> BinaryTree* right(BinaryTree *left) {
> if(!left) return;
> sum+=right(left->right);
> return sum;
> }
>
> BinaryTree *left(BinaryTree *right) {
> if(!right) return;
> sum+=left(right->left);
> return sum;
> }
>
> Thanks
>
> Supraja J
>
>
> On Sun, Mar 18, 2012 at 5:50 AM, rahul sharma wrote:
>
>> plz some one explain...i hav read online but getting the code and same
>> explanaiton...need it urgent...thnx in advance
>>
>>
>> On Sun, Mar 18, 2012 at 12:38 AM, rahul sharma 
>> wrote:
>>
>>> @anna..plz elaborate more...
>>>
>>>
>>> On Sun, Mar 18, 2012 at 12:26 AM, Supraja Jayakumar <
>>> suprajasank...@gmail.com> wrote:
>>>
 Hi

 I think its the sum of all the right children of the left subtree and
 left children of the right subtree. (Note: this does NOT apply recursively)

 Thanks


 On Sat, Mar 17, 2012 at 9:31 AM, rahul sharma 
 wrote:

> plz explain...i m nt able to get the concept.
>
>
> On Sat, Mar 17, 2012 at 8:50 PM, rahul sharma  > wrote:
>
>> how come 2,3,7 in vertical sum?
>>
>>
>> On Sat, Mar 17, 2012 at 3:48 PM, prashant thorat <
>> prashantnit...@gmail.com> wrote:
>>
>>> First , Do recursive traverse from root node and assign vertical
>>> level for each node. like this,
>>> for root node level = 0 , root->left level = -1 , root->left->right
>>> = 0 , root->left->left = -2, like this
>>>
>>>
>>> so below tree becomes,
>>>
>>>   1(0)
>>>/\
>>> 2(-1)3(1)
>>>  /  \   /\
>>> 4(-2)   5(0)  6(1)   7(2)
>>>
>>>
>>>
>>> After this again, take an array to store sum initialize to 0, and
>>> traverse tree again , while traversing store the value of that node in 
>>> it's
>>> level.
>>>
>>> This way u'll be able to calculate vertical sum.
>>>
>>>
>>> Thanks
>>>
>>> On Sat, Mar 17, 2012 at 3:29 PM, rahul sharma <
>>> rahul23111...@gmail.com> wrote:
>>>

  what is vertical sum in binayr tree...i dnt need the algo for
 this..just need the concept...that what is vertical sum???

 Given a Binary Tree, find vertical sum of the nodes that are in
 same vertical line. Print all sums through different vertical lines.

 Examples:

   1
 /   \
   2  3
  / \/ \
 4   5  6   7

 The tree has 5 vertical lines

 Vertical-Line-1 has only one node 4 => vertical sum is 4
 Vertical-Line-2: has only one node 2=> vertical sum is 2
 Vertical-Line-3: has three nodes: 1,5,6 => vertical sum is 1+5+6 =
 12
 Vertical-Line-4: has only one node 3 => vertical sum is 3
 Vertical-Line-5: has only one node 7 => vertical sum is 7

 So expected output is 4, 2, 12, 3 and 7

 --
 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.

>>>
>>>
>>>
>>> --
>>> Yours affectionately,
>>> Prashant Thorat
>>>
>>>
>>>  --
>>> 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.
>



 --
 U

 --
 You received this message because you are subscribed to the Google
 Groups "Algorithm Geeks" gr

Re: [algogeeks] Vertical Sum in a given Binary Tree

2012-03-19 Thread shady
nice explanation aman and prashant


1(0) / \ 2(-1) 3(1) / \ / \ 4(-2) 5(0) 6(0) 7(2)


As you see this example, each node has an extra attribute(not necessary
though) which tells its distance from the root node. Take map and as you
traverse the tree in any order, add the count to the map value.

Then the values of the map will give the vertical sums. There is no need to
keep an extra attribute, just by recursively traversing the tree we can
calculate its distance. One traversal will do.


On Sat, Mar 17, 2012 at 3:35 PM, Aman Raj  wrote:

> Vertical sum is sum of all the nodes that are present in same horizontal
> distance from the root.
> In the example quoted by you
> the root 1 is at 0 Horizontal distance from root, while its children are
> both -1 and +1 distance from root.
> Now take the case of 1,5 and 6, 1 being the root is at 0 horizontal
> distance, 5 being the right child of 2 ( which is at -1 distance ) is again
> at -1 + 1=0 horizontal distance, similarly 6 will be at +1-1 =0 Horizontal
> distance.
> Hope that helps.
>
> Thanks and regards,
> Aman Raj
>
> On Sat, Mar 17, 2012 at 3:29 PM, rahul sharma wrote:
>
>>
>>  what is vertical sum in binayr tree...i dnt need the algo for
>> this..just need the concept...that what is vertical sum???
>>
>> Given a Binary Tree, find vertical sum of the nodes that are in same
>> vertical line. Print all sums through different vertical lines.
>>
>> Examples:
>>
>>   1
>> /   \
>>   2  3
>>  / \/ \
>> 4   5  6   7
>>
>> The tree has 5 vertical lines
>>
>> Vertical-Line-1 has only one node 4 => vertical sum is 4
>> Vertical-Line-2: has only one node 2=> vertical sum is 2
>> Vertical-Line-3: has three nodes: 1,5,6 => vertical sum is 1+5+6 = 12
>> Vertical-Line-4: has only one node 3 => vertical sum is 3
>> Vertical-Line-5: has only one node 7 => vertical sum is 7
>>
>> So expected output is 4, 2, 12, 3 and 7
>>
>> --
>> 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] Re: Google written test

2012-03-19 Thread shady
@gene it does show your updated code.

@atul from the given input it seems different from Fibonacci encoding.

On Mon, Mar 19, 2012 at 5:32 PM, Gene  wrote:

> Thanks.
>
> I noticed this too.  If the n'th 1/0 digit is supposed to correspond
> with the n'th fibonacci number, then my original code would have been
> right.  But the example isn't done this way.
>
> I  fixed the code to match the example the evening of the 18th
> (Eastern time), but I guess the change is not showing on your server
> yet.
>
>
> On Mar 19, 3:16 am, atul anand  wrote:
> > @Gene :  your code will work fine by changing the argument passed from
> > main(), you just need to call rite  f(n, 1, 1); from main instead of
>  f(n,
> > 1, 0);
> >
> > On Mon, Mar 19, 2012 at 10:10 AM, atul anand  >wrote:
> >
> >
> >
> >
> >
> >
> >
> > > @all : i guess question is on Fibonacci coding.
> >
> > > here you can find the algo :-
> >
> > >http://en.wikipedia.org/wiki/Fibonacci_coding
> >
> > > On Sun, Mar 18, 2012 at 2:58 AM, Atul Singh  >wrote:
> >
> > >> @Ravi...  there should be only one answer as for fibonacci
> representation
> > >> of a number we have to include the part of the fibonacci number just
> less
> > >> than the number then remaining part of the sum is filled by fibonacci
> > >> numbers starting from 1
> >
> > >> suppose we have to convert 6 into fibonacci representation
> > >> then 6 has two sum sets as {1,2,3} or {1,5}
> >
> > >> then the fibonacci number just less than 6 is 5 so bit representing 5
> is
> > >> set then for completing the sum to 6 bit 1 is also set.
> > >> so *fibonacci representation of 6 is 1001 .* not 0111
> >
> > >> ATul Singh | Final Year  | Computer Science & Engineering | NIT
> > >> Jalandhar  | 9530739855 |
> >
> > >>  --
> > >> 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] Re: remove duplicates

2012-03-18 Thread shady
sorry, didn't get ?

On Sun, Mar 18, 2012 at 11:19 PM, Siddhartha Banerjee <
thefourrup...@gmail.com> wrote:

> in a string... yes, because there are only 256 possible characters (or
> 65536, in case of unicode), so just create a boolean array of length 256
> initialized to false and whenever a character occurs make the corresponding
> element true. While scanning the string, if an element has already
> appeared, delete it.
>
> --
> 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: remove duplicates

2012-03-18 Thread shady
possible but with constraints on the range of the numbers

On Sun, Mar 18, 2012 at 8:45 PM, rafi  wrote:

> i don't think it's possible (almost sure)
>
> On Mar 17, 3:41 pm, rahul sharma  wrote:
> > guys do we have algo to remove duplicates in o(n) time and in spce
> > comepexity 0(1)...in unsorted...array  or string.???
>
> --
> 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] ITRIX'12 OPC

2012-03-16 Thread shady
i wanted to try the questions now, but can't submit, can you provide the
problems, and testdata ?

On Mon, Mar 12, 2012 at 10:41 PM, Kashyap Krishnakumar  wrote:

> Hi,
> The online programming contest of ITRIX, the national level technical
> symposium of the Department of Information Sciences and Technology, College
> of Engineering Guindy is up and running. Prizes worth 15k to be won.
>
> Contest page: www.spoj.pl/ITRIX12/
>
> Participate and enjoy the contest. Have fun coding.
>
> --
> Kashyap.K,
> III year, B.E CSE,
> College of Engineering Guindy,
> Anna University,
> Chennai.
>
> --
> If you've never failed, you've never lived!
>
>  --
> 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] Floyd Warshall

2012-03-03 Thread shady
Can someone explain Flyod Warshall algorithm, i am unable to understand how
it works ?
even a good link will suffice, i am not getting the intuition behind it.

-- 
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: Regarding Wikipedia Download

2012-03-02 Thread shady
actually i wanted it for research purposes, one that i can download and
then use it

On Fri, Mar 2, 2012 at 8:17 PM, Dave  wrote:

> @Shady: This is pretty elementary. wikipedia.org lets you choose your
> language. But even if you didn't know that, you can google "spanish
> wikipedia" etc.
>
> Dave
>
> On Mar 2, 7:02 am, shady  wrote:
> > Hi,
> > Is there a place from where i can download Wikipedia for other languages
> > like Spanish, Hindi etc. ? If yes, please help, it is urgent. I googled a
> > bit, but couldn't find anything useful.
> >
> > Thanks.
>
> --
> 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] [Offtopic] Regarding Wikipedia Download

2012-03-02 Thread shady
Hi,
Is there a place from where i can download Wikipedia for other languages
like Spanish, Hindi etc. ? If yes, please help, it is urgent. I googled a
bit, but couldn't find anything useful.

Thanks.

-- 
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]

2012-03-02 Thread shady
"The function hash is the hash function the Linux kernel used in the dentry
cache." - quoted from the same paper, *SPEC SFS **is one example of dentry
hash function. Might wanna google to learn in detail, it has got of details
which i couldn't understand.*

On Fri, Mar 2, 2012 at 2:20 AM, aanchal goyal wrote:

> anyone knows what hash function is used in the name lookup procedure in
> linux?
>
> Procedure lookup(name)
> 1: h := hash(name)
> 2: dentryNode := hashtable(h)
> 3: while dentryNode != NULL do
> 4: if dentryNode- >name != name then
> 5: dentryNode := dentryNode- >next
> 6: else
> 7: return dentryNode
> 8: end if
> 9: end while
> --
> Regards,*
> Aanchal Goyal*.
>
>  --
> 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] puzzle

2012-02-29 Thread shady
anurag how did you reach that solution ?
can you elaborate...

On Wed, Feb 29, 2012 at 8:11 PM, Anurag atri wrote:

> nth term : (n! + 2^n - n)
>
>
> On Wed, Feb 29, 2012 at 11:05 AM, Vaibhav Mittal <
> vaibhavmitta...@gmail.com> wrote:
>
>> Ntn else is provided..??
>> On Feb 28, 2012 12:51 PM, "Gaurav Popli"  wrote:
>>
>>> Given a sequance of natural numbers.
>>>
>>> Find N'th term of this sequence.
>>>
>>> a1=2, a2=4, a3=11, a4=36, a5=147, a6=778 ... ... ... ... aN.
>>>
>>>
>>> this is a coding quesn and O(n) soln is also welcome...
>>>
>>> --
>>> 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.
>>
>
>
>
> --
> Regards
> Anurag Atri
>
>
>  --
> 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] thanx to all

2012-02-28 Thread shady
congrats :)
keep participating and keep learning.

On Wed, Feb 29, 2012 at 9:19 AM, atul anand  wrote:

> congo :)
>
>
> On Wed, Feb 29, 2012 at 5:30 AM, Varun Nagpal wrote:
>
>> cool
>>
>>
>> On Tue, Feb 28, 2012 at 9:22 PM, Ravi Ranjan wrote:
>>
>>> hey Geeks thanx a lot .. for the valuable information in the
>>> discussions
>>>
>>> i got selected in Yatra.com (R n D profile)
>>>
>>> thanx a lot for the algorithms explained by to guys
>>>
>>> THANX A LOT
>>>
>>> :D:D:D:D
>>>
>>>
>>> --
>>> 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] Puzzle

2012-02-27 Thread shady
logic ?

On Tue, Feb 28, 2012 at 11:16 AM, srikanth reddy malipatel <
srikk...@gmail.com> wrote:

> 66,68,70
>
> On Mon, Feb 27, 2012 at 6:54 PM, karthikeya s 
> wrote:
> > 3, 39, 41, 43, 45, 49, 51, 53, 55, 64, ?, ?, ...
> > (These are successive numbers sharing a common property. No math or
> > outside knowledge is needed.)
> >
> > --
> > 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.
> >
>
>
>
> --
> Srikanth Reddy M
> (M.Sc Tech.) Information Systems
> BITS-PILANI
>
> --
> 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 : Any hints[kth smallest contiguous sum] ?

2012-02-21 Thread shady
great solution :D
thanks.

On Wed, Feb 22, 2012 at 12:41 AM, sunny agrawal wrote:

> we need to find how many sums are less than candidate Sum chosen in one
> iteration of binary search in range 0-S
> To count this, for each i we try to find how many sums ending at i are
> lesser than candidate sum !!
>
> lets say for some i-1 sum[0 - i-1] < candidate sum then we can say that
> i*(i-1)/2 sums are less than candidate sum.
> now lets say after adding a[i] again sum[0 - i] < candidateSum then u can
> add (i+1) to previous count because all sums [0 - i], sum[1 - i],
> . sum[i - i] will be lesser than candidate sum
> or if adding a[i] causes sum[0 - i] > candidateSum then u have to find a
> index g such that sum[g - i] < candidate sum, and increase the count by
> ((i)-(g) +1).
>
> eg lets say your candidate sum is 7 (for the given example{1,2,3,4,5}) k =
> 3 n = 5
> initially g = 0
> sum = 0;
> candidateSum = 7;
> count = 0
> iteration one:
> sum[0 - 0] = 1 < 7  so count += 0-0+1;
>
> iteration 2
> sum[0-1] = 3 < 7,  count += 1-0+1
>
> iteration 3
> sum[0-2] = 6 < 7 count += 2-0+1;
>
> iteration 4
> sum[0,3] = 10 > 7 so now increment g such that sum[g,i] < 7
> so g = 3count += 3-3+1;
>
> iteration 5
> sum[3 - 4] = 9 > 7
> new g = 4 count += 4-4+1
>
> final count = 8, so there are 8 sums less than 7
>
>
>
> On Wed, Feb 22, 2012 at 12:16 AM, shady  wrote:
>
>> didn't get you, how to check for subsequences which doesn't start from
>> the beginning ? can you explain for that same example... should we check
>> for all contiguous subsequences of some particular length?
>>
>>
>> On Tue, Feb 21, 2012 at 11:15 PM, sunny agrawal 
>> wrote:
>>
>>> i dont know if a better solution exists
>>> but here is one with complexity O(N*logS)...
>>> N = no of elements in array
>>> S = max sum of a subarray that is sum of all the elements as all are
>>> positive
>>>
>>> algo goes as follows
>>> do a binary search in range 0-S, for each such candidate sum find how
>>> many sums are smaller than candidate sum
>>>
>>> there is also need to take care of some cases when there are exactly k-1
>>> sums less than candidate sum, but there is no contigious where sum =
>>> candidate sum.
>>>
>>>
>>> On Tue, Feb 21, 2012 at 11:02 PM, shady  wrote:
>>>
>>>> Problem link <http://www.spoj.pl/ABACUS12/status/ABA12E/>
>>>>
>>>> --
>>>> 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.
>>>>
>>>
>>>
>>>
>>> --
>>> Sunny Aggrawal
>>> B.Tech. V year,CSI
>>> Indian Institute Of Technology,Roorkee
>>>
>>>  --
>>> 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.
>>
>
>
>
> --
> Sunny Aggrawal
> B.Tech. V year,CSI
> Indian Institute Of Technology,Roorkee
>
>  --
> 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 : Any hints[kth smallest contiguous sum] ?

2012-02-21 Thread shady
can you do it for some example where k > N... i am confused

On Wed, Feb 22, 2012 at 12:22 AM, atul anand wrote:

> if i am getting it right 
>  input has only positive number then
> if k <= N (number of elements) , then it would similar to finding kth
> smallest element in the array. because we can consider each element in the
> input as a sub array.
>
> now if k > N , then we need to find (k-N)th smallest element which should
> be sum two or more elements.
>
> On Tue, Feb 21, 2012 at 11:15 PM, sunny agrawal 
> wrote:
>
>> i dont know if a better solution exists
>> but here is one with complexity O(N*logS)...
>> N = no of elements in array
>> S = max sum of a subarray that is sum of all the elements as all are
>> positive
>>
>> algo goes as follows
>> do a binary search in range 0-S, for each such candidate sum find how
>> many sums are smaller than candidate sum
>>
>> there is also need to take care of some cases when there are exactly k-1
>> sums less than candidate sum, but there is no contigious where sum =
>> candidate sum.
>>
>>
>> On Tue, Feb 21, 2012 at 11:02 PM, shady  wrote:
>>
>>> Problem link <http://www.spoj.pl/ABACUS12/status/ABA12E/>
>>>
>>> --
>>> 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.
>>>
>>
>>
>>
>> --
>> Sunny Aggrawal
>> B.Tech. V year,CSI
>> Indian Institute Of Technology,Roorkee
>>
>>  --
>> 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] Re : Any hints[kth smallest contiguous sum] ?

2012-02-21 Thread shady
didn't get you, how to check for subsequences which doesn't start from the
beginning ? can you explain for that same example... should we check for
all contiguous subsequences of some particular length?


On Tue, Feb 21, 2012 at 11:15 PM, sunny agrawal wrote:

> i dont know if a better solution exists
> but here is one with complexity O(N*logS)...
> N = no of elements in array
> S = max sum of a subarray that is sum of all the elements as all are
> positive
>
> algo goes as follows
> do a binary search in range 0-S, for each such candidate sum find how many
> sums are smaller than candidate sum
>
> there is also need to take care of some cases when there are exactly k-1
> sums less than candidate sum, but there is no contigious where sum =
> candidate sum.
>
>
> On Tue, Feb 21, 2012 at 11:02 PM, shady  wrote:
>
>> Problem link <http://www.spoj.pl/ABACUS12/status/ABA12E/>
>>
>> --
>> 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.
>>
>
>
>
> --
> Sunny Aggrawal
> B.Tech. V year,CSI
> Indian Institute Of Technology,Roorkee
>
>  --
> 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 : Any hints[kth smallest contiguous sum] ?

2012-02-21 Thread shady
Problem link 

-- 
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] TRIE problem

2012-02-14 Thread shady
will TRIE be the best solution for this problem ?

Link

-- 
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]

2012-02-12 Thread shady
output is compiler dependent.
search archives for more info.

On Sun, Feb 12, 2012 at 6:57 PM, Ratan  wrote:

> int i=2,x;
> x=(i++ + i++) * (i++ + ++i);
> printf("%d",x);
>
> o/p: 24
> plzzz justify this output...
> --
> --
> Ratan | 3rd Year | Information Technology | NIT ALLAHABAD
>
> --
> 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] Practical way to check the primality in efficent time

2012-02-11 Thread shady
There are many, but the one i know how to code is fermat's primality test.
How to calculate all prime numbers between a given range efficiently i read
somewhere that we can do bit-masking to store whether a number is prime or
not, thus saving space ?
I generally use double prime sieve.

On Sat, Feb 11, 2012 at 8:24 PM, rspr  wrote:

> what are the efficient ways to check that a given number is primer
> assuming the numbers can be large.
>
> --
> 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: Subset Generation

2012-02-10 Thread shady
answer is always +ve,

does anyone know how to code it ?

On Sat, Feb 11, 2012 at 11:37 AM, Tushar  wrote:

> for the given test case in the problem, answer could have been zero
>
> what does it mean by "without even reading zero" in the problm
> statement?
>
>
> On Feb 9, 11:34 pm, shady  wrote:
> > Hi All,
> > Anyway to implement this in a good mannerhttp://
> www.spoj.pl/ARHN/problems/PRINCESS, solution is simple,
> > check for ones and then generate numbers is an increasing number...
> > so if a number n = 22(10110)
> > then for k = 1, ans = 2(10)
> > then for k = 2, ans = 4(100)
> > then for k = 3, ans = 6(110)
> >
> > Shady
>
> --
> 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] Subset Generation

2012-02-09 Thread shady
Hi All,
Anyway to implement this in a good manner
http://www.spoj.pl/ARHN/problems/PRINCESS, solution is simple,
check for ones and then generate numbers is an increasing number...
so if a number n = 22(10110)
then for k = 1, ans = 2(10)
then for k = 2, ans = 4(100)
then for k = 3, ans = 6(110)


Shady

-- 
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] Spoj Domino Tiling

2012-02-09 Thread shady
well i have used three recurrences :P formed them by following a
traditional approach

f[i] = f[i-1] + 2*g[i-1] + h[i-1] + f[i-2];
   g[i] = f[i-1] + g[i-1];
   h[i] = f[i-1] + h[i-2];



On Thu, Feb 9, 2012 at 7:19 PM, Kunal Patil  wrote:

> I am solving spoj problem Tiling a Grid With
> Dominoes.(http://www.spoj.pl/problems/GNY07H/)..
> I am not able to come up with a recurrence relation..
> One of my friend said it has the recurrence relation as f(n) = f(n-1)
> + 5*f(n-2) + f(n-3) - f(n-4).
> I am not convinced and have trouble deriving this formula from given
> data..Can somebody help??
>
> --
> 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] Reading till EOF using cin

2012-02-07 Thread shady
hi,
how to read till end of file in c++ using cin ?


string str;
while(!cin.eof())
{

cin >> str;

cout << str << endl;

}
but it is not working correctly.

It is printing the last line twice. Can anyone tell why ?

-- 
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] ORDERS

2012-02-05 Thread shady
Hi, Any hints for this problem ?
 Link 

-- 
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: not recieving mails

2012-02-03 Thread shady
roflmao, how is it possible, go and check your settings :P
Google Groups are perfect.

On Fri, Feb 3, 2012 at 7:22 PM, aditya bindal wrote:

> me as well, it is quite awkward now, pls look into it.
>
> On Feb 2, 12:33 am, "arpit.gupta"  wrote:
> > HI,
> > i am not recieving any mails since 20 jan , plz chk
> > thank you
>
> --
> 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] Minimum number of jumps to reach end

2012-01-25 Thread shady
http://www.geeksforgeeks.org/archives/13209

On Thu, Jan 26, 2012 at 10:33 AM, Sanjay Rajpal wrote:

> Given an array of integers where each element represents the max number of
> steps that can be made forward from that element. Write a function to
> return the minimum number of jumps to reach the end of the array (starting
> from the first element). If an element is 0, then cannot move through
> that element.
>
> Example:
>
> *Input: arr[] = {1, 3, 5, 8, 9, 2, 6, 7, 6, 8, 9}
> Output: 3 (1-> 3 -> 8 ->9)*
>
>
> *
> Sanjay Kumar
> B.Tech Final Year
> Department of Computer Engineering
> National Institute of Technology Kurukshetra
> Kurukshetra - 136119
> Haryana, India
> Contact: +91-8053566286
> *
>
>  --
> 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: histogram

2012-01-23 Thread shady
http://stackoverflow.com/questions/4311694/maximize-the-rectangular-area-under-histogram
it is described here.

On Mon, Jan 23, 2012 at 3:16 PM, Ashish Goel  wrote:

> someone said that the solutionhas been given using the stack, can someone
> explain it, i did a lookup in my mail box and the solution for the
> histogram problem is not there. The gif tells how to proceed, however, not
> able to map it to how stack to be used.
>
> Best Regards
> Ashish Goel
> "Think positive and find fuel in failure"
> +919985813081
> +919966006652
>
>
> On Mon, Jan 23, 2012 at 10:57 AM, Ashish Goel  wrote:
>
>>  You are given an array which represents the heights of every bar of a
>> histogram. Now all these bars are contiguous (juxtaposed wrt each other)
>> and have the same width.
>> For Example, A={2,1,4} represents a histogram having 3 bars of height
>> 2,1and 4 in that order. Now you need to find a rectangle in this histogram
>> that has the maximum area.
>> See figure:
>> http://www.ocf.berkeley.edu/~wwu/YaBBAttachments/hist_rect.gif
>>
>> Time Complexity: O(n)
>> Space Complexity:O(1)
>> let the histogram given is 1,2,1,4,3,2,2,3,1,4,1,1,1,1,1,1
>>
>> the max is 16,  when i trying to use Ldistance, it is coming as 10.
>>
>> Alternatively, the logic of finding with all the consecutive bars
>> following a particular bar which are non-ascending is O(n^2)
>>
>>
>> any solutions?
>>
>>
>>
>>
>> Best Regards
>> Ashish Goel
>> "Think positive and find fuel in failure"
>> +919985813081
>> +919966006652
>>
>
>  --
> 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] fork command confusion

2012-01-17 Thread shady
answered by sunny. and output you mentioned is also wrong. search archives.

On Tue, Jan 17, 2012 at 5:31 PM, shady  wrote:

>
>
> On Tue, Jan 17, 2012 at 4:54 PM, Durgesh Kumar wrote:
>
>> #include
>>
>> int main()
>> {
>>int i=0;
>> printf("hello world \n");
>>i++;
>>fork();
>>printf("forking %d",i);
>>i++;
>>
>> }
>> o/p :-
>> hello world
>>
>> Can any1 explain this??
>>
>> On 1/17/12, Durgesh Kumar  wrote:
>> > How can we join after the forking 
>> >
>> > On 1/17/12, Durgesh Kumar  wrote:
>> >> #include
>> >>
>> >> int main()
>> >> {
>> >>  int i=0;
>> >> printf("helllo world %d\n",i);
>> >> i++;
>> >> fork(); //Fork Exeution Starts from here .
>> >> printf("hello forking %d\n",i);
>> >>  i++;
>> >>
>> >> }
>> >>
>> >> o/p:-
>> >> helllo world 0
>> >> hello forking 1
>> >> hello forking 1
>> >>
>> >>
>> >>
>> >>
>> >> On 1/17/12, himanshu kansal  wrote:
>> >>> #include
>> >>> int main()
>> >>> { printf("hello");
>> >>>fork();
>> >>>   printf("world");
>> >>> }
>> >>>
>> >>>
>> >>> what will be the o/p
>> >>>
>> >>> on my system...its showing hello world hello world...
>> >>>
>> >>> but i think it could be hello world two times in any order.
>> >>>
>> >>> please tell me what is the exact o/p...
>> >>>
>> >>> i have a little confusion also that whether child process starts
>> >>> executing from start of the main() or whether it starts from the line
>> >>> following the fork() command.
>> >>>
>> >>> --
>> >>> 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.
>> >>>
>> >>>
>> >>
>> >>
>> >> --
>> >> *Durgesh Kumar*
>> >> Final Year, B.tech
>> >> Information Technology
>> >> HALDIA INSTITUTE OF TCHNOLOGY
>> >> HALDIA
>> >>
>> >
>> >
>> > --
>> > *Durgesh Kumar*
>> > Final Year, B.tech
>> > Information Technology
>> > HALDIA INSTITUTE OF TCHNOLOGY
>> > HALDIA
>> >
>>
>>
>> --
>> *Durgesh Kumar*
>> Final Year, B.tech
>> Information Technology
>> HALDIA INSTITUTE OF TCHNOLOGY
>> HALDIA
>>
>> --
>> 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] fork command confusion

2012-01-17 Thread shady
On Tue, Jan 17, 2012 at 4:54 PM, Durgesh Kumar wrote:

> #include
>
> int main()
> {
>int i=0;
> printf("hello world \n");
>i++;
>fork();
>printf("forking %d",i);
>i++;
>
> }
> o/p :-
> hello world
>
> Can any1 explain this??
>
> On 1/17/12, Durgesh Kumar  wrote:
> > How can we join after the forking 
> >
> > On 1/17/12, Durgesh Kumar  wrote:
> >> #include
> >>
> >> int main()
> >> {
> >>  int i=0;
> >> printf("helllo world %d\n",i);
> >> i++;
> >> fork(); //Fork Exeution Starts from here .
> >> printf("hello forking %d\n",i);
> >>  i++;
> >>
> >> }
> >>
> >> o/p:-
> >> helllo world 0
> >> hello forking 1
> >> hello forking 1
> >>
> >>
> >>
> >>
> >> On 1/17/12, himanshu kansal  wrote:
> >>> #include
> >>> int main()
> >>> { printf("hello");
> >>>fork();
> >>>   printf("world");
> >>> }
> >>>
> >>>
> >>> what will be the o/p
> >>>
> >>> on my system...its showing hello world hello world...
> >>>
> >>> but i think it could be hello world two times in any order.
> >>>
> >>> please tell me what is the exact o/p...
> >>>
> >>> i have a little confusion also that whether child process starts
> >>> executing from start of the main() or whether it starts from the line
> >>> following the fork() command.
> >>>
> >>> --
> >>> 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.
> >>>
> >>>
> >>
> >>
> >> --
> >> *Durgesh Kumar*
> >> Final Year, B.tech
> >> Information Technology
> >> HALDIA INSTITUTE OF TCHNOLOGY
> >> HALDIA
> >>
> >
> >
> > --
> > *Durgesh Kumar*
> > Final Year, B.tech
> > Information Technology
> > HALDIA INSTITUTE OF TCHNOLOGY
> > HALDIA
> >
>
>
> --
> *Durgesh Kumar*
> Final Year, B.tech
> Information Technology
> HALDIA INSTITUTE OF TCHNOLOGY
> HALDIA
>
> --
> 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.



  1   2   3   4   5   >