Re: [algogeeks] need help??

2012-09-23 Thread b.raj kannan
any body know about juniper networks internship written test pattern..
please help me.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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] longest palindrome in a string size 2*10^4

2012-09-23 Thread Aditya Raman
Hello everybody,
I need to find a way of finding the longest palindrome in a very very long 
string (n=2) . a linear time algo is expected. help me out

-- 
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/-/JdXOBU9fu34J.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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 Written Test - 25 SEPT 2010

2012-09-23 Thread Rahul Kumar Patle
@dave sir: i understand your point, here my solution is only limited to
hold the divisor in range of integer..

On Sat, Sep 22, 2012 at 1:41 AM, Dave dave_and_da...@juno.com wrote:

 @Rahul: What does this print for n = 193?

 Dave

 On Friday, September 21, 2012 12:14:18 AM UTC-5, Rahul Kumar Patle wrote:

 here is my code:

 main()
 {
 int n=13;
 int divisor=1;
 int temp;
 while( divisor  n )
 divisor = 10 * divisor + 1;
 printf(%d\n , divisor);
 temp = divisor;
 while(n)
 {
 if(temp%n == 0)
 break;
 temp = 10 * (temp % n) + 1;
 divisor = 10 * divisor + 1;
 while( temp  n )
 {
 divisor = 10 * divisor + 1;
 temp = 10 * temp + 1;
 }
 printf(%d and %d\n , divisor, temp);
 }
 printf(%d\n, divisor);
 }



 On Fri, Sep 21, 2012 at 10:30 AM, Rahul Kumar Patle patlera...@gmail.com
  wrote:

 @navin: you have to find a number containing all 1's which is divisible
 by a given number xx...3, here given number contains 3 at it unit place...

 On Fri, Sep 21, 2012 at 10:25 AM, Navin Kumar algorit...@gmail.comwrote:

  @all: Please explain question number 8. I am not getting the question
 exactly what it says ?

 On Fri, Sep 21, 2012 at 9:30 AM, Dave dave_an...@juno.com wrote:

 @Bharat: Simulate long division, dividing a number ...1 by the
 number. You can do this one digit at a time, printing the quotient digit 
 by
 digit until you bring down a zero. It could look something like this:

 int n=the number that ends with 3;
 int divisor=1;
 while( divisor  n )
 divisor = 10 * divisor + 1;
 while( divisor != 0 )
 {
 printf(%d,divisor / n);
 divisor = 10 * (divisor % n) + 1;
 }
 printf(\n);

 Dave

 On Thursday, September 20, 2012 9:45:55 PM UTC-5, bharat wrote:

 what is the solution(not brute force) for 8th question ?

 On Fri, Sep 14, 2012 at 5:19 PM, Bhupendra Dubey bhupen...@gmail.com
  wrote:

 Which edition of barron?


 On Wed, Sep 28, 2011 at 6:05 PM, VIHARRI vihar...@gmail.com wrote:

 1. Java uses stack for byte code in JVM - each instruction is of one
 byte, so how many such instructions are possible in an operating
 system.

 2. Three processes p1, p2, p3, p4 - each have sizes 1GB, 1.2GB, 2GB,
 1GB. And each processes is executed as a time sharing fashion. Will
 they be executed on an operating system.

 3. write a recursive program for reversing the linked list.

 4. write a program for checking the given number is a palindrome.
 ( dont use string / array for converting number ).

 5. write a recursive program for multiplying two numbers a and b,
 with
 additions. The program should take care of doing min # additions as
 that of which ever number is lower between a and b.

 6. There are two sets A and B with n integers, write a program to
 check the whether there exists two numbers a in A and b in B such
 that
 a+b = val ( val is given );

 7. write a program to return the row number which has max no of
 one's
 in an array of NxN matrix where all 1's occur before any 0's starts.

 8. For every number that has 3 in its units place has one multiple
 which has all one's i.e. 111 is such multiple and 13 has a multiple
 11. Write a program to find such multiple for any number that
 has
 3 at its units place.

 9. what are the maximum no of edges that can be connected in a graph
 of n vertices and 0 edges such that after adding edges given graph
 is
 still disconnected.

 10. One Question on critical section.

 For Analytical Test - Prepare the Questions in the barrons book of
 sample paper - 2 ( they have give two passages )

 --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algo...@googlegroups.com.
 To unsubscribe from this group, send email to algogeeks+...@**
 googlegroups.com**.

 For more options, visit this group at http://groups.google.com/**
 group**/algogeeks?hl=enhttp://groups.google.com/group/algogeeks?hl=en
 .




 --
 Thanks  regards
 Bhupendra



  --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algo...@googlegroups.com.
 To unsubscribe from this group, send email to algogeeks+...@**
 googlegroups.com**.

 For more options, visit this group at http://groups.google.com/**
 group**/algogeeks?hl=enhttp://groups.google.com/group/algogeeks?hl=en
 .


  --
 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/-/pDBPxDR3R1oJhttps://groups.google.com/d/msg/algogeeks/-/pDBPxDR3R1oJ
 .

 To post to this group, send email to algo...@googlegroups.com.
 To unsubscribe from this group, send email to algogeeks+...@**
 googlegroups.com.
 For more options, visit this group at http://groups.google.com/**
 group/algogeeks?hl=en http://groups.google.com/group/algogeeks?hl=en
 .


  --
 You received this message because you are 

Re: [algogeeks] longest palindrome in a string size 2*10^4

2012-09-23 Thread Navin Kumar
 *Ukkonen's algorithm* is a linear-time, online
algorithmhttp://en.wikipedia.org/wiki/Online_algorithmfor
constructing suffix
trees http://en.wikipedia.org/wiki/Suffix_tree, proposed by Esko
Ukkonenhttp://en.wikipedia.org/w/index.php?title=Esko_Ukkonenaction=editredlink=1in
1995

source: wikipedia

On Sun, Sep 23, 2012 at 5:08 PM, Navin Kumar algorithm.i...@gmail.comwrote:

 Build a common suffix tree for the given string and for its reverse. Then
 take out the string ending at maximum depth at a common node. Time
 complexity would be linear.

 On Sat, Sep 22, 2012 at 5:33 PM, Aditya Raman 
 adityarareloa...@gmail.comwrote:

 Hello everybody,
 I need to find a way of finding the longest palindrome in a very very
 long string (n=2) . a linear time algo is expected. help me out

 --
 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/-/JdXOBU9fu34J.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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] longest palindrome in a string size 2*10^4

2012-09-23 Thread Rahul Kumar Dubey
 *Manacher's algorithm *
*
*
*Its a famous algorithm for finding longest palindrome in a string in O(n)*
*have a look at it on internet ...*
*http://www.leetcode.com/2011/11/longest-palindromic-substring-part-ii.html*
see if it can help you ..

On Sun, Sep 23, 2012 at 5:29 PM, Navin Kumar algorithm.i...@gmail.comwrote:

  *Ukkonen's algorithm* is a linear-time, online 
 algorithmhttp://en.wikipedia.org/wiki/Online_algorithmfor constructing 
 suffix
 trees http://en.wikipedia.org/wiki/Suffix_tree, proposed by Esko 
 Ukkonenhttp://en.wikipedia.org/w/index.php?title=Esko_Ukkonenaction=editredlink=1in
  1995

 source: wikipedia


 On Sun, Sep 23, 2012 at 5:08 PM, Navin Kumar algorithm.i...@gmail.comwrote:

 Build a common suffix tree for the given string and for its reverse. Then
 take out the string ending at maximum depth at a common node. Time
 complexity would be linear.

 On Sat, Sep 22, 2012 at 5:33 PM, Aditya Raman adityarareloa...@gmail.com
  wrote:

 Hello everybody,
 I need to find a way of finding the longest palindrome in a very very
 long string (n=2) . a linear time algo is expected. help me out

 --
 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/-/JdXOBU9fu34J.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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.




-- 
*RAHUL KUMAR DUBEY*
*BTech-3rd  year *
*Computer Science Engineering *
*Motilal Nehru National Institute Of Technology*
*Allahabad[211004],UP.*

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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] longest palindrome in a string size 2*10^4

2012-09-23 Thread SHOBHIT GUPTA
http://www.leetcode.com/2011/11/longest-palindromic-substring-part-ii.html:
linear time

On Sat, Sep 22, 2012 at 5:33 PM, Aditya Raman adityarareloa...@gmail.comwrote:

 Hello everybody,
 I need to find a way of finding the longest palindrome in a very very long
 string (n=2) . a linear time algo is expected. help me out

 --
 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/-/JdXOBU9fu34J.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


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



[algogeeks] Re: Amazon Question

2012-09-23 Thread xyz
have a look http://amnwidfrenz-thinkalways.blogspot.in/2012/09/string-
reduction.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] longest palindrome in a string size 2*10^4

2012-09-23 Thread Aditya Raman
@rahul: excellent answer. thanks a ton!!.
@navin :i will try that too .Thanks !!

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