rushikesh90
BAN USERThis is standard application of suffix tree. Lookup longest repeated substring.
- rushikesh90 May 20, 2015What is your time complexity?
- rushikesh90 May 18, 2015Reading the problem statement there is only one path..
- rushikesh90 May 18, 2015can you explain
- rushikesh90 May 18, 2015No need of binary search tree.. we need a simple graph again we can assume here that except the root all other nodes will have either one or no children
- rushikesh90 May 18, 2015This solution is effective but I dont see how is it recursive?
- rushikesh90 May 17, 2015bool isPalindrome(struct node *head)
{
struct node *last,*temp;
temp=head;
while(temp->next!=NULL)temp=temp->next;
last=temp;
return checkPalindrome(head,last);
}
bool checkPalindrome(struct node *head,struct node *last)
{
struct node *temp=head;
if(head==last)
return true;
while(temp->next!=last)temp=temp->next;
if(head-next==last)
{
if(head->data==next->data)
return true;
else
return false;
}
if(head->data==last->data)
{
return checkPalindrome(head->next,temp);
}
return false;
}
How does your solution will give total number of overlapping jobs or indices of jobs which are overlapping?
- rushikesh90 May 13, 2015The question is not asking for identical subtrees but foldable , so data of both subtrees can be different.
- rushikesh90 May 11, 2015The function recursiveSameTree is checking if the two subtrees are similar , but since the question is asking for foldable tree, the subtrees should be mirror copies of each other.
- rushikesh90 May 11, 2015
The problem can be solved in o(n) using suffix trees.
- rushikesh90 May 20, 2015