On Wednesday, July 18, 2012 4:26:11 AM UTC+8, Navin Kumar wrote:
@Dave sir,
K is known in advance. Many people including me think stack as an
appropriate data structure but still i am not satisfied with this answer.
In case K is not known in advance : according to your solution when a new
Manacher's algorithm does. I think it's a variant of Z algorithm.
On Dec 31 2010, 5:10 am, Aniket aniket...@gmail.com wrote:
How do you find the longest palindrome in a given string in O(n) time?
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks
.
On Sep 5, 10:14 am, Ray [EMAIL PROTECTED] wrote:
He has lost many books, since many of his friends borrow his books and
never bother to return them. He does not want to lose any more books
and has decided to keep a record of all books that he lends to his
friends. To make the task
He has lost many books, since many of his friends borrow his books and
never bother to return them. He does not want to lose any more books
and has decided to keep a record of all books that he lends to his
friends. To make the task of borrowing a book a little difficult, he
has given the
I think it's O(n).
Because the order of squareroot((log log m) / (log m)) is less than
m's.
T(n) = a T (n/b) + f(n)
1. O(n ^(lgb/lga) ) O(f(n))
T(n) = O(n ^(lgb/lga))
2. O(n ^(lgb/lga) ) = O(f(n))
T(n) = O(lg(n)*f(n))
3. O(n ^(lgb/lga) ) O(f(n))
T(n) = O(f(n))
The problem fits the 1st
Hey Minhaz,
I have the same algorithm w/z you.
#include stdio.h
#include algorithm
#include memory.h
#include string.h
#include vector
using namespace std;
const int MAX_N = 17;
int used[MAX_N];
int Prime (int n)
{
if(n==1)
return 0;
if(n==2)
Hi WangLei,
The approach you provide is to compute the angle of every point
pairpi, pj, i != j.
e.g. the angles are stored in an array. And then find the maxium
identical elements
of the array. So it's converted to find the Multitude Number:
1. Sort the array
2. traverse the array
It runs