[algogeeks] Kurukshetra OPC 2012

2012-01-31 Thread radha krishnan
Contest started.
http://www.spoj.pl/KOPC12/problems/main/sort=0,start=0
Top Indians can get internship at SAPLABS india.

-- 
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] Kurukshetra 2012 OPC

2012-01-29 Thread radha krishnan
Hi Coderz,
We would like to invite you all to participate in Kurukshetra OPC 2012
(An Individual Contest ), a 4-hour acm-icpc
style online programming competition, which is organized as a part
ofKurukshetra2012 , the Technical fest
of College Of Engineering Guindy, Anna
University,India.
You can look at our past contests here
Kurukshetra OPC 2009  Kurukshetra
OPC 2010
*Contest Page:* http://www.spoj.pl/KOPC12/

*Contact:* radhakrishnance...@gmail.com
*
*
*Problems :* 6-7 problems with mix of easy (2), medium (3) and hard (1-2)
levels.
*
*
*Prize Money in INR *
First Place: 15000 INR
II place  :   5000 INR
III place :   3000 INR

Please ignore this if you came to know about this contest by other means
.Sorry for that .
Regards,
Kurukshetra Team 2012,
CEG,Anna University,
Chennai, India.

-- 
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] DirectI -Written Test

2011-07-28 Thread radha krishnan
Anyone have an idea about DirectI Written test ?
Thanks in Advance !

Radhakrishnan,
CEG,AU,
Chennai

-- 
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] TIC TAC TOE

2011-07-28 Thread radha krishnan
Excuse me MR.balaji :P
U got selected for Microsoft Redmond :P still preparing ? :P

On Thu, Jul 28, 2011 at 6:01 AM, Balaji S  wrote:
> Given a 3X3 matrix , with 1's 0's and -1's ( 1 is player one 0 is player two
> -1 is none)
>
> how ll you find who is the winner / draw in a tic tac toe game in the most
> effiecient manner...
>
> --
> With Regards,
>     Balaji.S
>
> --
> 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] register storage class

2011-07-23 Thread radha krishnan
Ok ! ppl started asking about books and send it to me :P
stop this thread :P

On Sat, Jul 23, 2011 at 8:56 AM, Arshad Alam  wrote:
> @Prabhu.. I don't have Let Us C solution..if you have soft copy.. can you
> please send..
>
> On Sat, Jul 23, 2011 at 9:12 PM, prabhu J  wrote:
>>
>> ya its true. refer let us c solutions page no. 167
>>
>> On Sat, Jul 23, 2011 at 8:28 PM, Arshad Alam  wrote:
>>>
>>> Storage for a register storage class variable is allocated each time the
>>> control reaches the block in which it is present. (book Let us C page number
>>> 239)
>>> it is true or false please explain
>>>
>>>
>>> Thanks & Regards
>>> Arshad Nadeem Alam
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] C ouput

2011-07-23 Thread radha krishnan
same question in MS written :P


On Sat, Jul 23, 2011 at 5:49 AM, Manish Kumar  wrote:
> @Akshata:
> Whenever you increase any variable then it increases according to its type.
> Here the address of array 'a' is being increased.(  &a+1 ).
> so the address of 'a' will temporarily increased to 20 bytes and then that
> is assigned to ptr.
> so ptr is now pointing to any value in the memory just after the memory
> where 5 is stored.
> so when we print ptr[-1] it prints "5".
> I think it should be clear now.
> if not,plz let me inform.
>
> --
> 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] How to design Elevator Control system ?

2011-07-19 Thread radha krishnan
i think we should not use the answer from otherr ppl for these type of
questions ! This is design ! we have to think of ur own :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.



Re: [algogeeks] MICROSOFT

2011-07-18 Thread radha krishnan
Really MS asking garbage collection questions ? :P
2) if the DLL is not sorted then it takes O(n lgn ) to build the BST
but the code looks so bloated if we write the code
On Mon, Jul 18, 2011 at 4:59 AM, Balaji S  wrote:
>
> Convert a binary tree to binary search tree inplace..
> Convert a DLL to a binary search tree that is balanced.
> Implement a C++ garbage collector efficiently
>
>
>
> --
> With Regards,
>     Balaji.S
>
> --
> 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] Google interview question

2011-07-15 Thread radha krishnan
thats the challenge man ! if u are declaring a static Array of 2GB and
u might find the repeated element in second step then memory is waste
!
Thats why hashing ! hashing has complexity of O(n) only !
Instead you can simply use a BBST but complexity is O(n lgn)

On Fri, Jul 15, 2011 at 7:11 PM, Anand Shastri
 wrote:
> File has 4,300,000,000 integers if you hash it will create a distinct hash
> for 4,300,000,000 integers.
>
> On Fri, Jul 15, 2011 at 7:09 PM, radha krishnan
>  wrote:
>>
>> if number is (1<<31) -1  u declare a 2GB array ?
>>
>> On Fri, Jul 15, 2011 at 6:59 PM, Anand Shastri
>>  wrote:
>> > file any way contains integers why do we need hash those integers? why
>> > not
>> > use the same integers to index an array.
>> >
>> > On Fri, Jul 15, 2011 at 6:36 PM, radha krishnan
>> >  wrote:
>> >>
>> >> just hash it
>> >>
>> >> On Fri, Jul 15, 2011 at 6:28 PM, Anand Shastri
>> >>  wrote:
>> >> > Given a file containing 4,300,000,000  integers, how
>> >> > can you find one that appears at least twice
>> >> >
>> >> > --
>> >> > You received this message because you are subscribed to the Google
>> >> > Groups
>> >> > "Algorithm Geeks" group.
>> >> > To post to this group, send email to algogeeks@googlegroups.com.
>> >> > To unsubscribe from this group, send email to
>> >> > algogeeks+unsubscr...@googlegroups.com.
>> >> > For more options, visit this group at
>> >> > http://groups.google.com/group/algogeeks?hl=en.
>> >> >
>> >>
>> >> --
>> >> You received this message because you are subscribed to the Google
>> >> Groups
>> >> "Algorithm Geeks" group.
>> >> To post to this group, send email to algogeeks@googlegroups.com.
>> >> To unsubscribe from this group, send email to
>> >> algogeeks+unsubscr...@googlegroups.com.
>> >> For more options, visit this group at
>> >> http://groups.google.com/group/algogeeks?hl=en.
>> >>
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "Algorithm Geeks" group.
>> > To post to this group, send email to algogeeks@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > algogeeks+unsubscr...@googlegroups.com.
>> > For more options, visit this group at
>> > http://groups.google.com/group/algogeeks?hl=en.
>> >
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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



Re: [algogeeks] Google interview question

2011-07-15 Thread radha krishnan
if number is (1<<31) -1  u declare a 2GB array ?

On Fri, Jul 15, 2011 at 6:59 PM, Anand Shastri
 wrote:
> file any way contains integers why do we need hash those integers? why not
> use the same integers to index an array.
>
> On Fri, Jul 15, 2011 at 6:36 PM, radha krishnan
>  wrote:
>>
>> just hash it
>>
>> On Fri, Jul 15, 2011 at 6:28 PM, Anand Shastri
>>  wrote:
>> > Given a file containing 4,300,000,000  integers, how
>> > can you find one that appears at least twice
>> >
>> > --
>> > 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] Google interview question

2011-07-15 Thread radha krishnan
just hash it

On Fri, Jul 15, 2011 at 6:28 PM, Anand Shastri
 wrote:
> Given a file containing 4,300,000,000  integers, how
> can you find one that appears at least twice
>
> --
> 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] Test Mail - Plz ignore

2011-07-14 Thread radha krishnan
successfully ignored :P

On Thu, Jul 14, 2011 at 6:57 AM, Navneet Gupta  wrote:
> Sending a test mail after re-joining the group. Please ignore.
>
> --
> Regards,
> Navneet
>
> --
> 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] C DEBUGGING

2011-07-10 Thread radha krishnan
#include
void main(){
signed x;
unsigned y;
x = 10 +- 10u + 10u +- 10;
y = x;
if(x==y)
 printf("%d %d",x,y);
else if(x!=y)
 printf("%u  %u",x,y);
}
OUTPUT?

-- 
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] Merging Sorted Arrays

2011-07-07 Thread radha krishnan
ok ! i got a O(n lgn) finally
i don know exact complexity
Let N = size of first array
Find the first N smallest elements using one pointer in each array
now swap the list of elements  from index 0 to second-pointer in
second array to first array
with first_poiner+1 to N in first Array
I think this is O(n)

On Thu, Jul 7, 2011 at 12:53 PM, Piyush Sinha  wrote:
> @radha...i have an algo but its complexity is O(n^2)...check the
> following and see if there is any bug as I havent tested for all
> cases...also suggestions are welcomed:)
>
> main()
> {
>      int a[]= {1,3,77,78,88};
>      int b[]= {2,5,79,80,81,99};
>      int i=sizeof(a)/sizeof(a[0]) - 1;
>      int j=sizeof(b)/sizeof(b[0]) - 1;
>      int temp,k,m;
>      while(j>=0)
>      {
>                 if(a[i]>b[j])
>                 {
>                   temp = a[i];
>                   k=m=i;
>                   while(b[j]                   while(i-k)
>                   {
>                        a[i] = a[i-1];
>                        i--;
>                   }
>                   a[i] = b[j];
>                   b[j] = temp;
>                   i = m;
>                 }
>                 j--;
>      }
>      for(k=0;k            printf("%d ",a[k]);
>      puts("\n");
>      for(k=0;k            printf("%d ",b[k]);
>      puts("\n");
>      system("pause");
> }
>
>
> On 7/8/11, radha krishnan  wrote:
>> :Given two sorted arrays a[]={1,3,77,78,90} and b[]={2,5,79,81}. Merge
>> these two arrays, no extra spaces are allowed. Output has to be
>> a[]={1,2,3,5,77} and b[]={78,79,81,90}.
>>
>> --
>> 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.
>>
>>
>
>
> --
> *Piyush Sinha*
> *IIIT, Allahabad*
> *+91-8792136657*
> *+91-7483122727*
> *https://www.facebook.com/profile.php?id=10655377926 *
>
> --
> 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] Merging Sorted Arrays

2011-07-07 Thread radha krishnan
:Given two sorted arrays a[]={1,3,77,78,90} and b[]={2,5,79,81}. Merge
these two arrays, no extra spaces are allowed. Output has to be
a[]={1,2,3,5,77} and b[]={78,79,81,90}.

-- 
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] DP or DFS

2011-07-06 Thread radha krishnan
nothing :P BFS :P

On Wed, Jul 6, 2011 at 1:23 PM, KK  wrote:
> https://www.spoj.pl/problems/SHOP/
> Anybody plzz post a solution to the above problem...
> i tried with dp but it failed...
> How to implement with DFS or if possible with DP???
>
> --
> 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] Bipartite Matching?

2011-07-05 Thread radha krishnan
never mind am wrong ! :P :P

On Tue, Jul 5, 2011 at 12:07 PM, radha krishnan
 wrote:
> This is a gud question  thougth the answer is not bipartitie matching
>
> If the graph has a cycle then answer is impossible
> The next question is whether the graph is connected ?
> say 1)when the graph is connected then it should be a tree to get
> split into two groups easily by assigning some colors / (some 0 / 1)
> like
> else 2) each component is a tree which can be split into two
> Correct me if am wrrong
>
> On Tue, Jul 5, 2011 at 11:55 AM, Nitish Garg  wrote:
>> Given a network of the employees of a company such that edges are between
>> those employees who are friends to each other. Divide the employees into two
>> teams such that no two people who are friends to each other are in the same
>> team?
>>
>> I was asked this question during the phonic interview with Google, though I
>> couldn't come across the correct solution at that time, I want to discuss
>> this question now.
>> To start with, is this a question of Bipartite Matching?
>>
>> --
>> 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/-/i_bA44doHU8J.
>> 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] Bipartite Matching?

2011-07-05 Thread radha krishnan
This is a gud question  thougth the answer is not bipartitie matching

If the graph has a cycle then answer is impossible
The next question is whether the graph is connected ?
say 1)when the graph is connected then it should be a tree to get
split into two groups easily by assigning some colors / (some 0 / 1)
like
else 2) each component is a tree which can be split into two
Correct me if am wrrong

On Tue, Jul 5, 2011 at 11:55 AM, Nitish Garg  wrote:
> Given a network of the employees of a company such that edges are between
> those employees who are friends to each other. Divide the employees into two
> teams such that no two people who are friends to each other are in the same
> team?
>
> I was asked this question during the phonic interview with Google, though I
> couldn't come across the correct solution at that time, I want to discuss
> this question now.
> To start with, is this a question of Bipartite Matching?
>
> --
> 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/-/i_bA44doHU8J.
> 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] Anyone have "The google resume book"

2011-06-27 Thread radha krishnan
+1 :P

On Tue, Jun 28, 2011 at 12:27 AM, hary rathor  wrote:
> very funny ! every one know this site swathi
>
> --
> 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] Office Suite

2011-06-27 Thread radha krishnan
You asked the Most Efficient dude

On Mon, Jun 27, 2011 at 10:29 PM, vaibhav agarwal
 wrote:
> @radha: hw abt using a fixed size circular list?
>
> On Sat, Jun 25, 2011 at 8:25 PM, radha krishnan
>  wrote:
>>
>> simple!!
>>  Stack:P
>>
>> On Sat, Jun 25, 2011 at 8:11 PM, rShetty  wrote:
>> > Suggest the most efficient Data Structures and algorithms to implement
>> > Undo and Redo operations in any of the Office Suites ?
>> >
>> > --
>> > 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] Sorting Array

2011-06-26 Thread radha krishnan
Yes ! Count Sort !!

On Sun, Jun 26, 2011 at 1:44 PM, ross  wrote:
> Given a sequence of numbers in the range of 1-N^2, what is the most
> efficient way to sort the numbers (better than NlgN)..
> Can counting sort be used here? Is an O(N) solution possible..
>
> --
> 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] Office Suite

2011-06-25 Thread radha krishnan
simple!!
 Stack:P

On Sat, Jun 25, 2011 at 8:11 PM, rShetty  wrote:
> Suggest the most efficient Data Structures and algorithms to implement
> Undo and Redo operations in any of the Office Suites ?
>
> --
> 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] Algorithmic Pioneers

2011-06-23 Thread radha krishnan
Include Euler !!!

On Fri, Jun 24, 2011 at 12:11 PM, Vishnutej Mylavarapu <
mylavarapu.vishnu...@gmail.com> wrote:

> You can add AC Rush too..
>
>
> On Fri, Jun 24, 2011 at 11:27 AM, rajeev bharshetty 
> wrote:
>
>> @ankit Thanks for the suggestion , I ahve Updated to include petr
>> Mitrichev :)
>>
>>
>> On Fri, Jun 24, 2011 at 11:19 AM, ankit sablok wrote:
>>
>>> very nice man nice collection add Petr Mitrichev to this collection
>>>
>>>
>>> On Fri, Jun 24, 2011 at 11:14 AM, rShetty  wrote:
>>>
 Collection of Algorithmic Pioneers can be Found here


 http://openprobe.blogspot.com/2011/06/pioneers-in-algorithm-deisgn-and.html

 Suggestion for addition of more Pioneers are 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.
>>>
>>
>>  --
>> 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.
>>
>
>
>
> --
>
> *-Vishnutej Mylavarapu.*
>
>  --
> 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] Amazon - Longest palindrome in a string in O(n)

2011-06-22 Thread radha krishnan
@balaji : i think u understand the question in wrong way !!
The solution is to use Manchar Algorithm !! But thats hard to implement

On Wed, Jun 22, 2011 at 12:05 AM, Balaji S  wrote:

>
>
> LCS(string,reverse(string)) ?? but this is not O(n) ryt..
>
>
>
> --
> With Regards,
> Balaji.S
>
>
>  --
> 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] Intuitive Understanding of XOR Operation

2011-06-13 Thread radha krishnan
Another use of XOR is to generate some random numbers
And XOR is extensively used in the field of CryptoGraphy !!!

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

2011-06-09 Thread radha krishnan
Ma approach is to xor the given number with all numbers in the file !!
This takes O(n)
I think we cant achieve a complexity  wrote:

> Given a file containing roughly 300 million social security numbers(9-
> digit numbers) find a 9-digit number that isnt there in the file. You
> have unlimited drive space but only 2mb of RAM.
>
> Solution is as follows:
> In the first step, we build an array of 2^16 integers that is
> initialized to 0 and for every number in the file we take its 16 most
> significant
> bit to index into this array and increment that number. Since there
> are less than 2^32 numbers in the file there is bound to be one number
> in the array that is less than 2^16 . This tells us that there is at
> least one number missing among the possible numbers with those upper
> bits. In the second pass, we can focus only on the numbers that match
> this criterion and use a bit-vector of size 2^16 to identify one of
> the missing numbers.
>
> Someone plz explain this solution( may be using some small values
> numbers) or suggest another approach.
>
> --
> 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] MS question

2011-06-02 Thread radha krishnan
@balaji :)
This is a question
 But don tell this is a MS quesiton :P :P :P

On Thu, Jun 2, 2011 at 11:40 PM, Balaji S  wrote:

> how s that output obtained??
>
> --
> 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] for intelligent people

2011-05-28 Thread radha krishnan
Can u please leave this Group
 ? ?? ?

On Sat, May 28, 2011 at 1:12 PM, sunny  wrote:

>
> hi all of you you all can earn 2000+ money from internet by just
> spending sometime.i have done this and it's awesome  really .
> .so i am sharing the link .so hurryit
> takes maximum 2
> minuts for registration
> http://www.earnparttimejobs.com/index.php?id=3407956
>
> --
> 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] ms ques

2011-05-27 Thread radha krishnan
Check whether this is storing  Google  Search Results ? ? ?? ? ? ? ? ??
[HONEY POTTING]

On Fri, May 27, 2011 at 10:07 PM, UTKARSH SRIVASTAV  wrote:

> test cases for internet explorer
>
> --
> *UTKARSH SRIVASTAV
> CSE-3
> B-Tech 2nd 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] Google Interview Question

2011-05-27 Thread radha krishnan
10100 is max ans
okay
convert the numbers to strings and sort based on the first character !!!
if equal do that recursively  and then if length is less give that
preference !!
i think this solution ..
may be this is wrong !!

On Fri, May 27, 2011 at 7:07 PM, wujin chen  wrote:

> @Piyush, how to deal with this case :100 , 10
>
>
> 2011/5/27 Piyush Sinha 
>
>> we can work out if we sort according to the leftmost integer
>>
>> On 5/27/11, adityasir...@gmail.com  wrote:
>> > are you kidding me. Just simple sort wont work.
>> >
>> > On Fri, May 27, 2011 at 9:31 AM, radha krishnan <
>> > radhakrishnance...@gmail.com> wrote:
>> >
>> >> sort :)
>> >>
>> >>
>> >> On Fri, May 27, 2011 at 6:57 PM, ross  wrote:
>> >>
>> >>> Hi all,
>> >>>
>> >>> Given an array of elements find the largest possible number that can
>> >>> be formed by using the elements of the array.
>> >>>
>> >>> eg: 10 9
>> >>> ans: 910
>> >>>
>> >>> 2 3 5 78
>> >>>
>> >>> ans: 78532
>> >>>
>> >>> 100 9
>> >>>
>> >>> ans: 9100
>> >>>
>> >>> --
>> >>> 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.
>> >
>> >
>>
>>
>> --
>> *Piyush Sinha*
>> *IIIT, Allahabad*
>> *+91-8792136657*
>> *+91-7483122727*
>> *https://www.facebook.com/profile.php?id=10655377926 *
>>
>> --
>> 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] Google Interview Question

2011-05-27 Thread radha krishnan
Haha !! Any counter  case against sort ? ?? ? :P

On Fri, May 27, 2011 at 7:02 PM,  wrote:

> are you kidding me. Just simple sort wont work.
>
> On Fri, May 27, 2011 at 9:31 AM, radha krishnan <
> radhakrishnance...@gmail.com> wrote:
>
>> sort :)
>>
>>
>> On Fri, May 27, 2011 at 6:57 PM, ross  wrote:
>>
>>> Hi all,
>>>
>>> Given an array of elements find the largest possible number that can
>>> be formed by using the elements of the array.
>>>
>>> eg: 10 9
>>> ans: 910
>>>
>>> 2 3 5 78
>>>
>>> ans: 78532
>>>
>>> 100 9
>>>
>>> ans: 9100
>>>
>>> --
>>> 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] Google Interview Question

2011-05-27 Thread radha krishnan
sort :)

On Fri, May 27, 2011 at 6:57 PM, ross  wrote:

> Hi all,
>
> Given an array of elements find the largest possible number that can
> be formed by using the elements of the array.
>
> eg: 10 9
> ans: 910
>
> 2 3 5 78
>
> ans: 78532
>
> 100 9
>
> ans: 9100
>
> --
> 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] Admin of Group

2011-05-26 Thread radha krishnan
+100

On Thu, May 26, 2011 at 9:26 PM, pacific :-)  wrote:

> +1
>
>
> On Wed, May 25, 2011 at 11:48 PM, anuj agarwal wrote:
>
>> Hi,
>>
>> Are there any admins on this group? I recently joined this group and i
>> liked the discussions going on here.
>>
>> But there is a problem which hurts is that unlike other groups which are
>> moderated by certain admin guys (also active members of group), this one is
>> not.
>> So we are receiving lots of SPAMS. I guess no body wants to get a job from
>> this group (specially ones which are sent by some Panzer).
>>
>> If the mods are reading this, Please take some action on that mails so
>> that group will remain clean.
>>
>> Sorry for off topic.
>>
>> Anuj Agarwal
>> Engineering is the art of making what you want from things you can get.
>>
>> --
>> 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,
> chinna.
>
>  --
> 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] [brain teaser ] W Riddle 16 may

2011-05-16 Thread radha krishnan
^like :P :P :P
ALL :P :P

On Mon, May 16, 2011 at 4:22 PM, Balaji S  wrote:

> 0, ther are no w's in all  :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] imporatnt(need help)

2011-04-26 Thread radha krishnan
May be he s innocent


On Tue, Apr 26, 2011 at 10:02 PM, saurabh singh  wrote:

> And sincerely hope no one helps him in near future too..
>
> Disgrace on the spirit of coding
> On Tue, Apr 26, 2011 at 9:38 PM, radha krishnan <
> radhakrishnance...@gmail.com> wrote:
>
>> Are u mad man ?
>> WTF ?
>> wats ur TC handle ?
>>
>>
>>
>> On Tue, Apr 26, 2011 at 9:22 PM, Aakash Johari wrote:
>>
>>> You can ask the solution after the contest. :)
>>>
>>>
>>> On Tue, Apr 26, 2011 at 8:50 AM, Gunjan Sharma >> > wrote:
>>>
>>>> @Kamlesh: In this world this thing is termed as cheating. I wish
>>>> nobody helps u on this
>>>>
>>>>
>>>> On Tue, Apr 26, 2011 at 9:17 PM, Saravanan T 
>>>> wrote:
>>>>
>>>>> Post the question!
>>>>>
>>>>>
>>>>> On Tue, Apr 26, 2011 at 7:38 PM, kamlesh yadav <
>>>>> kamleshlu2...@gmail.com> wrote:
>>>>>
>>>>>> plaese be online at 8.30 pm today  if possible and please help me.
>>>>>>
>>>>>> On Tue, Apr 26, 2011 at 7:19 PM, kamlesh yadav <
>>>>>> kamleshlu2...@gmail.com> wrote:
>>>>>> > hello friends
>>>>>> >  i NEED UR HUMBLE SUPPORT
>>>>>> >
>>>>>> >   I will post a question after an hour, if
>>>>>> > anybody can solve it for me as early as possible (probably within 45
>>>>>> > minutes), then please solve it and send it ti me. I urgently need it
>>>>>> > my idkamleshlu2...@gmail.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.
>>>>>> >
>>>>>> >
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Kamlesh Kumar Yadav
>>>>>> MCA  Department of Computer Science
>>>>>> Delhi University
>>>>>>
>>>>>> --
>>>>>> 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
>>>> Gunjan Sharma
>>>> Chairman IEEE Students Chapter IIT Roorkee
>>>> B.Tech IV year CSE
>>>>
>>>> Contact No- +91 9997767077
>>>>
>>>>  --
>>>> 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.
>>>>
>>>
>>>
>>>
>>> --
>>> -Aakash Johari
>>> (IIIT 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.
>>
>
>
>
> --
> Saurabh Singh
> B.Tech (Computer Science)
> 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] imporatnt(need help)

2011-04-26 Thread radha krishnan
Are u mad man ?
WTF ?
wats ur TC handle ?


On Tue, Apr 26, 2011 at 9:22 PM, Aakash Johari wrote:

> You can ask the solution after the contest. :)
>
>
> On Tue, Apr 26, 2011 at 8:50 AM, Gunjan Sharma 
> wrote:
>
>> @Kamlesh: In this world this thing is termed as cheating. I wish
>> nobody helps u on this
>>
>>
>> On Tue, Apr 26, 2011 at 9:17 PM, Saravanan T wrote:
>>
>>> Post the question!
>>>
>>>
>>> On Tue, Apr 26, 2011 at 7:38 PM, kamlesh yadav 
>>> wrote:
>>>
 plaese be online at 8.30 pm today  if possible and please help me.

 On Tue, Apr 26, 2011 at 7:19 PM, kamlesh yadav 
 wrote:
 > hello friends
 >  i NEED UR HUMBLE SUPPORT
 >
 >   I will post a question after an hour, if
 > anybody can solve it for me as early as possible (probably within 45
 > minutes), then please solve it and send it ti me. I urgently need it
 > my idkamleshlu2...@gmail.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.
 >
 >



 --
 Kamlesh Kumar Yadav
 MCA  Department of Computer Science
 Delhi University

 --
 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
>> Gunjan Sharma
>> Chairman IEEE Students Chapter IIT Roorkee
>> B.Tech IV year CSE
>>
>> Contact No- +91 9997767077
>>
>>  --
>> 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.
>>
>
>
>
> --
> -Aakash Johari
> (IIIT 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] Calculate sum of matrix

2011-04-01 Thread radha krishnan
Google For Power Series

use matrix exponentiation

Complexity O(n^3 (logn)^2)

On Fri, Apr 1, 2011 at 9:25 PM, Rahul Singal  wrote:
> Hi geeks,
> Please help me in solving this problem
> you have to sum  m+ m^2 + m^3 . + m^n where m is a square matrix
>
> how to efficiently do this  better than O(n) time ??
>
> Thanks
> Rahul
>
> --
> 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] Announcing ITRIX OPC 2011

2011-03-27 Thread radha krishnan
All solutions are opened in spoj

On Sun, Mar 27, 2011 at 11:03 PM, Raunak Agrawal  wrote:
> Can you please provide the question...as I am not able to see the problem :(
>
> On Sun, Mar 27, 2011 at 10:58 PM, Kunal Patil  wrote:
>>
>> How to solve that "Lucky Sequence Again" problem...
>> i tried it using vectors...for small values it succeeded..
>> but it wasn't calculating for 10^10 or for large condition..
>> So what was the logic to solve the problem ???
>>
>> --
>> 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] Announcing ITRIX OPC 2011

2011-03-27 Thread radha krishnan
Hi,

We would like to invite you all to participate in ITRIX OPC 11(An
Individual Contest ), a 2-hour acm-icpc style online programming
competition, which is organized as a part of ITRIX 2011 , the
Technical fest of DIST ,College Of Engineering Guindy India.
Start time : Sunday ,27th March 2011,8 pm IST .
[ Find when it starts in your time zone Time in Other Zones]

Contest Page: https://www.spoj.pl/ITRIX11/


Contact: radhakrishnance...@gmail.com

Problems : 5 - 6 problems with mix of easy (2), medium (2) and hard
(1-2) levels.

Prize Money in INR
First Place: 1 INR
II place : 3000 INR
III place : 2000 INR

-- 
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] ITRIX OPC 2011

2011-03-26 Thread radha krishnan
Hi,

We would like to invite you all to participate in ITRIX OPC 11(An
Individual Contest ), a 2-hour acm-icpc style online programming
competition, which is organized as a part of ITRIX 2011 , the
Technical fest of DIST ,College Of Engineering Guindy India.
Start time : Sunday ,27th March 2011,8 pm IST .


Contest Page: https://www.spoj.pl/ITRIX11/

Problem Setters: innocentboy2,sundargates
Contact: radhakrishnance...@gmail.com

Problems : 5 - 6 problems with mix of easy (2), medium (2) and hard
(1-2) levels.

Prize Money in INR
First Place: 1 INR
II place : 3000 INR
III place : 2000 INR

-- 
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] ITRIX OPC 2011 -------Prizes worth 16000 INR to be won and exciting prizes

2011-03-24 Thread radha krishnan
ITRIX OPC 2011 ---Prizes worth 16000 INR to be won and exciting prizes
The contest will be conducted in SPOJ.
Participants must register in ITRIX WEBSITE(http://itrix.org.in) in
order to be eligible for prizes.. Prizes worth 16000 INR to be won ..
Link for Trial Run is
https://www.spoj.pl/ITRIXTST/

All the best and Happy Coding :)

-- 
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] Itrix OPC TRIAL RUN

2011-03-24 Thread radha krishnan
ITRIX OPC PRACTICE RUN STARTED http://www.spoj.pl/ITRIXTST
Happy codin :)

-- 
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] An Interesting Question Calculate nth Power of Integer

2011-03-24 Thread radha krishnan
You can do it in (log n) assuming multiplication is O(1)
suppose u are going to calculate 8 power 33
u compute 8 power 16 and multiply with the same to get 8 power 32
then multiply with 8 to get the result

On Thu, Mar 24, 2011 at 1:04 PM, AAMIR KHAN  wrote:
> Try this...
> #include 
> #include 
> using namespace std;
> #define DIGITS 10001
> void mult(int N,int pro[],int &len) {
>    int carry = 0;
>    for(int i=0;i       int temp = pro[i]*N + carry;
>       pro[i] = temp%10;
>       carry = temp/10;
>    }
>
>    if(carry>0) {
>       pro[len] = carry;
>       len++;
>    }
>
> }
> int main() {
>    int t,N,E;
>
>    scanf("%d",&t);
>    while(t--) {
>       int pro[DIGITS];
>       scanf("%d %d",&N,&E);
>       if(N==1) {
>       printf("1 1\n");
>       continue;
>       }
>       pro[0] = 1; int len = 1;
>       for(int i=0;i            mult(N,pro,len);
>       }
>
>       for(int i=len-1;i>=0;i--) {
>          printf("%d",pro[i]);
>      }
>       printf("\n");
>
>    }
>    return 0;
> }
>
> Here t stands for number of testcases...
> N => the number for which power is to be calculated..
> E => the exponent..
> On Thu, Mar 24, 2011 at 12:22 PM, bittu  wrote:
>>
>> How you will print the 100th power of a single digit( which is of type
>> int). How do you maintain that big number in memory?
>>
>>
>> Lets C The Approach
>>
>> Thank & Regards
>> Shashank
>>
>> --
>> 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] RR Scheduling

2011-03-21 Thread radha krishnan
U have to use Some  Advanced Data Structures for this problem
:P
On Mon, Mar 21, 2011 at 3:02 PM, saurabh singh  wrote:
> using scanf and printf and still tle,I am not pretty sure how malloc or new
> arrays can speed up execution?
>
> On Mon, Mar 21, 2011 at 2:25 PM, sanchit mittal  wrote:
>>
>> use scanf n printf instead of cin n cout,
>> malloc array of structures after reading value of n if working in c else
>> use new in cpp
>> rest i guess...is ok
>> On Sun, Mar 20, 2011 at 11:53 PM, ankit sambyal 
>> wrote:
>>>
>>> I worked on this problem but cud not get a more efficient algo than
>>> yours.
>>> Plz get back 2 me if u find a better algo.
>>>
>>> On Sun, Mar 20, 2011 at 3:24 AM, Akshata Sharma
>>>  wrote:

 I tried to solve this problem
 https://www.spoj.pl/problems/RRSCHED/

 I am getting TLE!! How can I improve my code??

 #include
 #include

 using namespace std;

 struct process
 {
 long time;
 int finished;
 long elapsed_time;
 };

 int main()
 {
 long n,sum=0;
 cin>>n;
 struct process prss[5];
 for(long i=0;i>>> {
     scanf("%ld",&prss[i].time);
     prss[i].finished=0;
     sum+=prss[i].time;
 }
 long index=0;
  for(long k=1;k<=sum;k++)
 {
   while(prss[index].finished==1)
   index++;

   prss[index].time--;

   if(prss[index].time==0)
   {
    prss[index].finished=1;
    prss[index].elapsed_time=k;
   }

   index++;
   if(index==n)
   index=0;
 }

 for(long i=0;i>>> printf("%ld\n",prss[i].elapsed_time);
 return 0;
 }


 --
 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.
>>
>>
>>
>> --
>> Sanchit Mittal
>> Second Year Undergraduate
>> Computer Engineering
>> Delhi College of Engineering
>> ph- +919582414494
>>
>> --
>> 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.
>
>
>
> --
> Saurabh Singh
> B.Tech (Computer Science)
> 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] Storing 1 million phone numbers

2011-02-28 Thread radha krishnan
Using a Trie
with 10 tries with roots 0,1,2,.9


On Tue, Mar 1, 2011 at 2:47 AM, Sudhir mishra  wrote:
>  best way , Memory-wise, to store 10 Crores mobile numbers ?
>
>  this is an interview question of Google.
>
> its a bit too easy.
>
> --
> 
>
> Thanks & Regards...
> Sudhir Mishra
> IT 3rd YEAR
> Motilal Nehru National institute Of Technology-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] Array , Number Missing or Duplicate ..

2011-02-26 Thread radha krishnan
XOR :P

On Sat, Feb 26, 2011 at 10:11 PM, bittu  wrote:
> Given an array of integers where some numbers repeat 1 time, some
> numbers repeat 2 times and only one number repeats 3 times, how do you
> find the number that repeat 3 times.
>
>
>
> Thanks
> Shashank
>
> --
> 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] Pairwise Sum & Array

2011-02-23 Thread radha krishnan
This s a topcoder problem :)

On Wed, Feb 23, 2011 at 7:16 PM, bittu  wrote:
> If pairwise sums of 'n' numbers are given in non-decreasing order
> identify the individual numbers. If the sum is corrupted print -1
> Example:
> i/p:
> 4 5 7 10 12 13
>
> o/p:
> 1 3 4 9
>
>
> Thanks & Regards
> Shashank
>
> --
> 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]

2011-02-23 Thread radha krishnan
Dynamic Programming :P

On Wed, Feb 23, 2011 at 7:19 PM, Balaji S  wrote:
> can anyone help??
>
>  how to convert a string into a palindrome..with MINIMUM NUMBER OF
> SUBSTITUTIONS ( operations..)
>
> --
> balaji ;-)
>
> --
> 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] height determination

2011-02-07 Thread radha krishnan
BinarySearch ?

On Mon, Feb 7, 2011 at 3:29 PM, snehal jain  wrote:
> You are given a no. of identical balls and a building with N floors.
> you know that there is an integer X< N such that ball will break if it
> is dropped from any floor X or higher but it will remain intact if
> dropped from a floor below X.
> Given K balls and N floors, what is the minimum no. of ball drops that
> are required to determine X in the worst case?
>
> --
> 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

2011-02-06 Thread radha krishnan
i use CountSort as i assuming maxn=20 :)
and then find the adjacent diff of the sorted array to find the min

On Sun, Feb 6, 2011 at 7:21 PM, Gajendra Dadheech  wrote:
> algo fails for following input set
> 20,18,1,7,2
>
> Thanks and regards,
> Gajendra Dadheech
>
>
>
>
> On Sun, Feb 6, 2011 at 6:32 PM, coolfrog$ 
> wrote:
>>
>> @Decipher
>> Microsoft is coming in over college.. can you Give some more question
>> which are recently asked ...in MS test...
>> @everone.. do share question of MS if some body has given the recently
>> this Test..
>>
>> Algorithm:
>> 1. maintain min_diff so far
>> 2. maintain max_element so far
>>  complexity is O(n) , and space == O(1)
>> #include
>> #include
>> #include
>> int minDiff(int arr[], int arr_size)
>> {
>>   int min_diff = abs(arr[1] - arr[0]);
>>   int max_element = arr[0];
>>   int i;
>>   for(i = 1; i < arr_size; i++)
>>   {
>>     if(abs(arr[i] - max_element) < min_diff)
>>   min_diff = abs(arr[i] - max_element);
>>     if(arr[i] > max_element)
>>  max_element = arr[i];
>>   }
>>   return min_diff;
>> }
>>
>>
>> int main()
>> {
>>   int arr[] = {5, 13, 7, 0, 10,20,1,15,4,19};
>>   printf("Maximum difference is %d",  minDiff(arr, 10));
>>   getchar();
>>   return 0;
>> }
>>
>> On Sun, Feb 6, 2011 at 3:37 PM, Abhijit K Rao 
>> wrote:
>>>
>>> How about , using a sorting algorithm like Quick sort and return diff of
>>> last and the before last element.
>>>
>>> Best Regards
>>> Abhijit
>>>
>>>
>>> On Sun, Feb 6, 2011 at 3:29 PM, Decipher  wrote:

 Algorithm to find the two numbers whose difference is minimum among the
 set of numbers.

 For example the sequence is 5, 13, 7, 0, 10, 20, 1, 15, 4, 19

 The algorithm should return min diff = 20-19 = 1.

 Constraint - Time Complexity O(N) & Space is not a constraint [upto
 O(3N)]

 --
 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.
>>
>>
>>
>> --
>> Divesh
>> (¨`·.·´¨) Always
>>   `·.¸(¨`·.·´¨ ) Keep
>>   (¨`·.·´¨)¸.·´Smiling!
>>    `·.¸.·´" Life can give u 100's of reason 2cry,but u can give life
>> 1000's
>> of reasons 2Smile"
>>
>> --
>> 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: kurukshetra...

2011-02-06 Thread radha krishnan
that should be (a+b+abs(a-b))/2

On Sun, Feb 6, 2011 at 4:15 PM, Manmeet Singh  wrote:
> test case : a = -1, b = - 1
> Result : fight successfully challenged dave's problem. Method returned 1
> while it shud have returned -1.
>
> On Sun, Feb 6, 2011 at 4:12 PM, Balaji S  wrote:
>>
>> thanks..
>>
>>
>> --
>> balaji ;-)
>>
>> --
>> 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]

2011-02-05 Thread radha krishnan
guess the output

main()
{
 int x=(1,024),y;
 y=1,024;
 printf("%d %d",x,y);
}

-- 
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: codechef problem

2011-02-02 Thread radha krishnan
I wonder U people discuss the solution during the contest ?

On Wed, Feb 2, 2011 at 11:59 PM, Bhavesh agrawal  wrote:
> if we just use hashing to store the different slope values 
>
> On Wed, Feb 2, 2011 at 7:45 PM, bittu  wrote:
>>
>> @above
>>
>> Use Simple Mathematics What is collinear Point...?? what is condition
>> of collinearity..?? thats it You have done
>>
>> Three or more points P1, P2, P3, ..., are said to be collinear if they
>> lie on a single straight line  L  similarly for N Points ..
>>
>> Let us start from the Very Basic Mathematical  Approach
>>
>> Since any 2 points determine 1 line, take 2 of the points and find the
>> equation of the line drawn thru these 2 points.
>> Substitute the x and y of the either point into the equation and find
>> the y-intercept (b)
>>
>> Then, substitute the x and y of the 3rd point into the equation and
>> see if the both sides of the equation are =.
>>
>> (y2-y1) ÷ (x2 - x1) = slope
>>
>> y = slope * x + b
>>
>>
>> Point # 1 = (6, 5)=p1
>> Point # 2 = (10, 25)=p1
>> Point # 3 = (12, 30)=p1
>> Point # 4 = (12, 35)=p1
>>
>>
>> (y2 - y1) ÷ (x2 - x1) = slope
>> (25 - 5) ÷ (10 - 6) = slope
>> (20) ÷ (4) = slope
>> Slope = 5
>> y = m * x + b
>> y = 5 * x + b
>>
>> Substitute the x and y of the point (6, 5) into the equation and find
>> the y-intercept (b)
>> y = 5 * x + b
>> 5 = 5 * 6 + b
>> 5 = 30 + b
>> b = -25
>> y = 5 * x - 25
>> .
>> Check your points
>> Point # 1 = (6, 5)
>> 5 = 5 * 6 - 25
>> 5 = 30 - 25 OK
>> .
>> Point # 2 = (10, 25)
>> 25 = 5 * 10 - 25
>> 25 = 5 * 10 - 25 OK
>> .
>> Then, substitute the x and y of the 3rd point into the equation and
>> see if the both sides of the equation are
>> Point # 3 = (12, 30)
>> .
>> y = 5 * x - 25
>> 30 = 5 * 12 - 25
>> 30 = 60 - 25 = 35
>> Point # 3 = (12, 30) is not on the line
>> .
>> .
>> Point # 4 = (12, 35)
>> 35 = 5 * 12 - 25
>> 35 = 60 - 25 =35
>> Point # 4 = (12, 35) is on the line
>>
>> so we can p1,p2,p4 are Collinear
>>
>>
>> 2nd Appraoch Used by Actual Geeks
>>
>> as we Two points are trivially collinear since two points determine a
>> line.
>>
>> Three points x_i=(xi,yi,zi) for i=1, 2, 3 are collinear if the ratios
>> of distances satisfy
>>
>> x2-x1:y2-y1:z2-z1=x3-x1:y3-y1:z3-z1
>>
>> A slightly more notice  that the area  of a triangle  determined by
>> three points will be zero iff  they are collinear (including the
>> degenerate cases of two or all three points being concurrent), i.e.,
>>
>> | x1 y1 1 |
>> | x2 y2 1 |=0
>> | x3 y3 1 |
>>
>>
>> or, in expanded form,
>> x1(y2-y3)+x2(y3-y1)+x3(y1-y2)=0
>>
>> Still If You Have the Doubt Let Me Know & if Any found that anything
>> wrong in this..please write correct & efficient ways  to do it.
>>
>> Thanks & Regards
>> Shashank ""The best way to escape from a problem is to solve 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.
>

-- 
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] Good Maths Question

2011-01-24 Thread radha krishnan
DP 
and a SPOJ Problem to :)

http://www.spoj.pl/problems/MONONUM/


On Mon, Jan 24, 2011 at 3:55 PM, monu  wrote:
> Dear All,
>
> Increasing integers can be defined as each of their digits is not greater
> than the digit to the right, and integers for which each digit is not lesser
> than the digit to the right as decreasing integers. For example 24558 is
> increasing, 888410 is decreasing and 5 - is both increasing and decreasing.
>
> Given n (no of digits) how to calculate the number of the decreasing n-digit
> integers to the increasing n-digit integers.
>
> For example:
> n=2
> inc. intergers = 45
> dec. intergers = 54
>
>
> --
> 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] NAGARRO CODING QUES............

2011-01-24 Thread radha krishnan
there s O (2^(n/2) ) solution with binary searching for sum :)

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

2011-01-20 Thread radha krishnan
See Topcoder Dynamic Programming Tutorials :)

On Fri, Jan 21, 2011 at 12:48 PM, snehal jain  wrote:
> A sequence of numbers is called a zig-zag sequence if the differences
> between successive numbers strictly alternate between positive and
> negative. The first difference (if one exists) may be either positive
> or negative. A sequence with fewer than two elements is trivially a
> zig-zag sequence.
>
> For example, 1,7,4,9,2,5 is a zig-zag sequence because the differences
> (6,-3,5,-7,3) are alternately positive and negative. In contrast,
> 1,4,7,2,5 and 1,7,4,5,5 are not zig-zag sequences, the first because
> its first two differences are positive and the second because its last
> difference is zero.
>
> Given a sequence of integers, sequence, return the length of the
> longest subsequence of sequence that is a zig-zag sequence. A
> subsequence is obtained by deleting some number of elements (possibly
> zero) from the original sequence, leaving the remaining elements in
> their original order.
>
> --
> 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] Ideal String

2011-01-20 Thread radha krishnan
Here s the solution from Topcoder.com/tc

http://www.topcoder.com/tc?module=Static&d1=match_editorials&d2=srm405

On Fri, Jan 21, 2011 at 12:54 PM, radha krishnan
 wrote:
> Whats the range of length ?
>
> On Fri, Jan 21, 2011 at 11:42 AM, snehal jain  wrote:
>> An ideal string is a string where the 1-based index of the first
>> occurrence of each letter is equal to the number of occurrences of
>> that letter in the string. For example, the “BAOOOA” is an ideal
>> string (quotes for clarity only). The letter ‘B’ appears 1 time, and
>> its index is 1. The letter ‘A’ occurs 2 times and its first index is
>> 2. The letter ‘O’ occurs 3 times and its first index is 3.
>>
>> Given an int length, return the lexicographical smallest ideal string
>> of that length containing only uppercase letters (‘A’-'Z’). If there
>> are no such ideal strings of that length, return an empty String
>> instead.
>>
>> --
>> 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] Ideal String

2011-01-20 Thread radha krishnan
Whats the range of length ?

On Fri, Jan 21, 2011 at 11:42 AM, snehal jain  wrote:
> An ideal string is a string where the 1-based index of the first
> occurrence of each letter is equal to the number of occurrences of
> that letter in the string. For example, the “BAOOOA” is an ideal
> string (quotes for clarity only). The letter ‘B’ appears 1 time, and
> its index is 1. The letter ‘A’ occurs 2 times and its first index is
> 2. The letter ‘O’ occurs 3 times and its first index is 3.
>
> Given an int length, return the lexicographical smallest ideal string
> of that length containing only uppercase letters (‘A’-'Z’). If there
> are no such ideal strings of that length, return an empty String
> instead.
>
> --
> 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] recursions

2011-01-14 Thread radha krishnan
http://zobayer.blogspot.com/2009/12/cse-102-practice-recursions.html

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

2011-01-14 Thread radha krishnan
Floyd Warshall ?

On Fri, Jan 14, 2011 at 6:45 PM, bittu  wrote:
>  You have N computers and [Ca, Cb] means a is connected to b and this
> connectivity is symmetric and transitive. then write a program which
> checks this
>
> Regards
> Shashank
>
> --
> 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] google written

2011-01-14 Thread radha krishnan
There s O(n) solution for this :)

On Fri, Jan 14, 2011 at 2:13 PM, radha krishnan
 wrote:
> append the string to original string and
> index=answer of that spoj problem
> now u can ouput the string from index to index+strlen(originalstring)-1
>
> On Fri, Jan 14, 2011 at 2:12 PM, radha krishnan
>  wrote:
>> wow
>> This s a spoj problem
>> http://www.spoj.pl/problems/MINMOVE/
>>
>> On Fri, Jan 14, 2011 at 1:40 PM, snehal jain  wrote:
>>> Write the code to find lexicographic minimum in a circular array, e.g.
>>> for the array
>>> BCABDADAB, the lexicographic mininum is ABBCABDAD.
>>>
>>> --
>>> 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] google written

2011-01-14 Thread radha krishnan
append the string to original string and
index=answer of that spoj problem
now u can ouput the string from index to index+strlen(originalstring)-1

On Fri, Jan 14, 2011 at 2:12 PM, radha krishnan
 wrote:
> wow
> This s a spoj problem
> http://www.spoj.pl/problems/MINMOVE/
>
> On Fri, Jan 14, 2011 at 1:40 PM, snehal jain  wrote:
>> Write the code to find lexicographic minimum in a circular array, e.g.
>> for the array
>> BCABDADAB, the lexicographic mininum is ABBCABDAD.
>>
>> --
>> 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] google written

2011-01-14 Thread radha krishnan
wow
This s a spoj problem
http://www.spoj.pl/problems/MINMOVE/

On Fri, Jan 14, 2011 at 1:40 PM, snehal jain  wrote:
> Write the code to find lexicographic minimum in a circular array, e.g.
> for the array
> BCABDADAB, the lexicographic mininum is ABBCABDAD.
>
> --
> 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 Again

2011-01-12 Thread radha krishnan
@jammy: Sorry for wrong answer
thats O(n^3 *lg(K))


On Thu, Jan 13, 2011 at 12:28 AM, Jammy  wrote:
> I think you meant n^3*log(K).
> Multiplication on two matrices would take O(n) per entry. And total
> #entries is n*n, thus multiplying 2 matrices takes O(n^3)
> To get a^(K), use simple divide-and-conquer technique. Since once one
> gets a^(K/2), to get a^(K) only needs to square it.
> Now we get T(K) = T(K/2)+O(multiply)--->T(K) = logK*O(multiply) =
> n^3*logK.
>
> On Jan 12, 8:04 am, radha krishnan 
> wrote:
>> Using Matrix Exponentiation technique
>> Complexity is n^3*(lg n) for matrix n x n
>> we need two n x n matrix to raise the matrix to power K ..
>> Correct me if am wronf
>>
>> On Wed, Jan 12, 2011 at 6:28 PM, bittu  wrote:
>> > How will you raise a n x n matrix to the power k efficiently. What's
>> > the time complexity and space complexity of you algorithm? How will
>> > you optimize this?
>>
>> > Thanks &Regards
>> > Shashank "Don't b Evil U Can Earn While U Learn"
>>
>> > --
>> > You received this message because you are subscribed to the Google Groups 
>> > "Algorithm Geeks" group.
>> > To post to this group, send email to algoge...@googlegroups.com.
>> > To unsubscribe from this group, send email to 
>> > algogeeks+unsubscr...@googlegroups.com.
>> > For more options, visit this group 
>> > athttp://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 algoge...@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 algoge...@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] Amazon Again

2011-01-12 Thread radha krishnan
Using Matrix Exponentiation technique
Complexity is n^3*(lg n) for matrix n x n
we need two n x n matrix to raise the matrix to power K ..
Correct me if am wronf

On Wed, Jan 12, 2011 at 6:28 PM, bittu  wrote:
> How will you raise a n x n matrix to the power k efficiently. What's
> the time complexity and space complexity of you algorithm? How will
> you optimize this?
>
>
> Thanks &Regards
> Shashank "Don't b Evil U Can Earn While U Learn"
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Algorithm Geeks" group.
> To post to this group, send email to algoge...@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 algoge...@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] Adobe - Algorithm

2011-01-09 Thread radha krishnan
This s merging two linked lists

On Sun, Jan 9, 2011 at 6:42 PM, Decipher  wrote:
> Convert in O(n) time and O(1) space :
> a1,a2,a3,a4,.aN,b1,b2,b3,b4,.,bN to
> a1,b2,a2,b2,a3,b3,a4,b4,..aN,bN.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Algorithm Geeks" group.
> To post to this group, send email to algoge...@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 algoge...@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: Linear Recurrences

2011-01-09 Thread radha krishnan
You find this so useful 
http://zobayer.blogspot.com/2010/11/matrix-exponentiation.html

On Sun, Jan 9, 2011 at 6:10 PM, shady  wrote:
> I am not familiar with such techniques, can you please refer to some article
> where such techniques are explained,  ...
> Regards,
> Shady
>
> On Sun, Jan 9, 2011 at 5:44 PM, juver++  wrote:
>>
>> There is very useful technique for this kind of problem.
>> A(n) = C1 * A(n-1) - C2 * A(n-2) + C3 * A(n - 3).
>> Let's introduce matrix B:
>> C1 -C2 C3
>>   1    0    0
>>   0    1    0.
>>        A(n-1)     A(n)
>> B x  A(n-2)  = A(n-1)
>>        A(n-3)     A(n-2)
>> and so on..
>> So to find A(n) you should muultiply matrix B^n by initial vector (A2, A1,
>> A0).
>> B^n can be calculated using fast exponention algorithm.
>> Complexity is O(k^3 * log(n)), where k - size of the matrix B, so k=3.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algoge...@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 algoge...@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 algoge...@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] Linear Recurrences

2011-01-09 Thread radha krishnan
yes,u can use matrix exponentiation

On Sun, Jan 9, 2011 at 3:49 PM, shady  wrote:
> hi all,
>
> Is there a way to find a formula for the nth element of a linear recurrence
> ? Instead of going linearly one by one
> c1, c2, c3 are the three constants.
> a(n+3) = c1*a(n+2) - c2*a(n+1) + c3*a(n)
>
> thanks.
>
> shady
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algoge...@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 algoge...@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] codechef jan challenge

2011-01-02 Thread radha krishnan
Wow: Its a Running Contest :)

On Sun, Jan 2, 2011 at 11:07 PM, sanchit mittal  wrote:
> http://www.codechef.com/JAN11/problems/FLUSHOT/
> m getting wrong answer
> if there is any problem wid my algorythm do let me know
>
>> #include
>>
>> int main()
>>
>> {
>>
>>     int t,D,N,j,i;
>>
>>     float T,*x,*y,*z,maxNo,minNo;
>>
>>     scanf("%d",&t);
>>
>>     while(t--)
>>
>>     {
>>
>>         scanf("%d %f",&N,&T);
>>
>>         x=(float*)malloc(sizeof(float)*(N+1));
>>
>>         y=(float*)malloc(sizeof(float)*(N+1));
>>
>>         z=(float*)malloc(sizeof(float)*(N+1));
>>
>>         for(i=0;i>
>>         {
>>
>>             scanf("%f",&x[i]);
>>
>>             }
>>
>>         if((x[1]+x[0])<=T || x[0]==0)
>>
>>         {
>>
>>             maxNo=x[0];
>>
>>             for(i=1;i>
>>             {  x[i]-=i*T;
>>
>>             if(x[i]<0)
>>
>>                x[i]=-x[i];
>>
>>             if(x[i]>maxNo)
>>
>>                maxNo=x[i];
>>
>>                       }
>>
>>
>>
>>             }
>>
>>         else
>>
>>         {    maxNo=0.0;
>>
>>              j=0;
>>
>>              for(i=0;i>
>>              {
>>
>>                  y[i]=x[i]-(x[0]+i*T);
>>
>>                  if(y[i]<0)
>>
>>                    { z[j]=-y[i];}
>>
>>                  if(y[i]>maxNo)
>>
>>                    { maxNo=y[i];}
>>
>>
>>
>>
>>
>>                  if(z[j]>minNo && j!=0 &&y[i]<0)
>>
>>                     { minNo=z[j];}
>>
>>                  if(y[i]<0)
>>
>>                     {j++;}
>>
>>                   if(j==1 &&y[i]<0)
>>
>>                     {minNo=z[0];}
>>
>>                     }
>>
>>
>>
>>                     if(N==2)
>>
>>                          maxNo=maxNo/2;
>>
>>                     else maxNo=(maxNo+minNo)/2;
>>
>>
>>
>>              }
>>
>>
>>
>>            printf("%.4f\n",maxNo);
>>
>>         }
>>
>>
>>
>>         return 0;
>>
>>     }
>
> --
> Sanchit Mittal
> Second Year Undergraduate
> Department of Computer Engineering
> Delhi College of Engineering
> ph- +919582414494
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algoge...@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 algoge...@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] Amazon Question

2010-12-26 Thread radha krishnan
with BST  we can query the occurence in lg (n)

On Sun, Dec 26, 2010 at 5:19 PM, mohit ranjan  wrote:
> @Radha
>
> With BST, the time taken to search a node depends on size (n), which will
> keep on increasing as stream grows long, whereas we need to calculate freq
> within the fixed time interval for all numbers...
>
>
> any better solution ?
>
> Mohit
>
>
> On Sun, Dec 26, 2010 at 4:48 PM, radha krishnan
>  wrote:
>>
>> An Augmented and self Balancin Binary Search Tree Will suffice
>> Tree {
>>       int element;
>>       int occurence;
>> }
>> when u have the element in the BST increment the occurence
>> Else create a New node
>> Total Complexity is O(n lgn )
>> Correct me if am wrong
>> lg n -- for finding the previous occurence of the number
>>
>> On Sun, Dec 26, 2010 at 4:39 PM, bittu  wrote:
>> > You are provided with a stream of numbers, design a data structure to
>> > store the numbers in the stream along with their no. of occurrences.
>> >
>> >
>> >
>> > Regards
>> > Shashank Mani
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "Algorithm Geeks" group.
>> > To post to this group, send email to algoge...@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 algoge...@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 algoge...@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 algoge...@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] Amazon Question

2010-12-26 Thread radha krishnan
An Augmented and self Balancin Binary Search Tree Will suffice
Tree {
   int element;
   int occurence;
}
when u have the element in the BST increment the occurence
Else create a New node
Total Complexity is O(n lgn )
Correct me if am wrong
lg n -- for finding the previous occurence of the number

On Sun, Dec 26, 2010 at 4:39 PM, bittu  wrote:
> You are provided with a stream of numbers, design a data structure to
> store the numbers in the stream along with their no. of occurrences.
>
>
>
> Regards
> Shashank Mani
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Algorithm Geeks" group.
> To post to this group, send email to algoge...@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 algoge...@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: Find all the subset of an array whose sum is equal to some number

2010-12-25 Thread radha krishnan
This s similar to the problem
https://www.spoj.pl/problems/SUBSUMS/
we have to split the array into 2 arrays
say A,B
generate all subsets of each array(both A and B) and another
array(A1,B1) to store the sum of each subset
now take each element of A1 and binarysearch B1 to achieve this sum
assume k=2^(n/2)
overall complexity is (2*(2^(n/2)) + 2*(k(lgk)) +k lgk)
2^(n/2) for each subset  so 2*(2^(n/2))
k(lg k) -- sorting so 2*(k lg k)
k(lgk)--binary search

On Sat, Dec 25, 2010 at 10:38 PM, Puneet Ginoria
 wrote:
> sorry i forgot to attach here it is
>
> On Sat, Dec 25, 2010 at 10:34 PM, Puneet Ginoria 
> wrote:
>>
>> This attachment contains the code for the above program in SML language
>> and it uses lambda calculus.
>>
>> On Sat, Dec 25, 2010 at 9:18 PM, juver++  wrote:
>>>
>>> What you need to get for the answer - amount of such subsets or display
>>> them?
>>> First problem can be solved using DP.
>>> Second - brute force.
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algoge...@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 algoge...@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 algoge...@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] zigzag

2010-12-15 Thread radha krishnan
This s nothing but a Topcoder problem based on Dynamic programming
link here
http://www.topcoder.com/tc?module=Static&d1=tournaments&d2=tccc03&d3=semiprob3


On Wed, Dec 15, 2010 at 6:56 PM, divya  wrote:
> A sequence of numbers is called a zig-zag sequence if the differences
> between successive numbers strictly alternate between positive and
> negative. The first difference (if one exists) may be either positive
> or negative. A sequence with fewer than two elements is trivially a
> zig-zag sequence.
>
> For example, 1,7,4,9,2,5 is a zig-zag sequence because the differences
> (6,-3,5,-7,3) are alternately positive and negative. In contrast,
> 1,4,7,2,5 and 1,7,4,5,5 are not zig-zag sequences, the first because
> its first two differences are positive and the second because its last
> difference is zero.
>
> Given a sequence of integers, sequence, return the length of the
> longest subsequence of sequence that is a zig-zag sequence. A
> subsequence is obtained by deleting some number of elements (possibly
> zero) from the original sequence, leaving the remaining elements in
> their original order.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Algorithm Geeks" group.
> To post to this group, send email to algoge...@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 algoge...@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] help me reduce the time limit

2010-12-08 Thread radha krishnan
see TC forums :

On Wed, Dec 8, 2010 at 10:44 PM, ankit sablok  wrote:
> please help mewritea program for this problem to reduce the time limit
>
> http://www.codechef.com/problems/FLIPCOIN/
>
> thnx in advance i have ben banging my head on this for a full day
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Algorithm Geeks" group.
> To post to this group, send email to algoge...@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 algoge...@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: sum of primes

2010-09-27 Thread radha krishnan
These are called Twin Primes ...:)))

On Thu, Sep 23, 2010 at 11:29 PM, Rishi Agrawal
 wrote:
> Apart from 1, 2 and 3, all the prime numbers are either of the form (6*n -
> 1) or (6*n + 1).
>
> Can we use this property to generate the primes till we get 1 primes.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algoge...@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 algoge...@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] Maximum of N numbers

2010-09-06 Thread radha krishnan
Count Sort and return the last element in the array

On Mon, Sep 6, 2010 at 7:11 PM, Rahul Singal wrote:

> You can use division operator
>
> pseudocode
>
> A[1,2,3.N]
> max=A[1];
> for i=2,3,.N
>  if( A[i]/max  !=0)
>max=A[i];
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algoge...@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 algoge...@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.