Animesh Sinha
BAN USER
- 0of 0 votes
AnswersGiven a convex polygon with n vertices, find the farthest pair of vertices in O(n) time.
- Animesh Sinha in India| Report Duplicate | Flag | PURGE
Algorithm
A Rope is generally used in text editing programs for manipulating large strings.
- Animesh Sinha August 10, 2013This answer is wrong. There is no constraint on the range of values in the input.
- Animesh Sinha September 01, 2012Traverse till the middle of the linked list and then reverse the linked list from the middle to the end inplace. After that, just compare the elements from the head and the middle.
Time Complexity = O(n)
Space Complexity = O(1)
See Cormen , Page - 360...by Dynamic Programming
- Animesh Sinha July 28, 2012That would take O(nlogn) time.
- Animesh Sinha July 09, 2012Yeah... figured it out..thanks for pointing out
- Animesh Sinha July 06, 2012Reason?
- Animesh Sinha July 06, 2012Is this correct?
- Animesh Sinha July 06, 2012is there any solution better than O(n^2).
- Animesh Sinha July 03, 2012isn't this wrong?
if u give input = 314, then according to u, F(0) = 1, F(1) = 1 , F(2) = 1, whereas F(2) will be 2.
is not writing a return statement at the end a reason for the error because the main function is defined as "int" ?
- Animesh Sinha July 03, 2012
You don't have the parent pointers. How will you apply BFS ?
- Animesh Sinha September 10, 2013