[algogeeks] Print the diameter of a binary tree
Hi All, I know how to find the diameter of given binary tree but i don't know how to print the diameter (this longest path). Can somebody please give a code snippet for this? Thanks, Pawan. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com.
[algogeeks] Max difference of Monotonic Pair in An Array
Hi All, Can anyone help me solving this problem ? Given a non-empty array A consisting of N integers. Find Max(j-i), s.t 0=i=jN and A[i]=A[j] Here (i, j) is a Monotonic Pair, satisfying the above condition. Space Complexity : O(n) Time Complexity: O(n) -- Regards... -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To unsubscribe from this group and stop receiving emails from it, send an email to algogeeks+unsubscr...@googlegroups.com.