building tree will take O(n) time but for each node we need to find max i.e
  i = max (inorder, start, end);

so complexity in worst case will we O(n^2).

On Tue, Nov 6, 2012 at 12:26 AM, shady <sinv...@gmail.com> wrote:

> Sorting takes linear time, but it doesnt get repeated n times,
>
> it is like - T(n) = 2*T(n/2) + O(n)
>
> worst case solution is O(n^2)
>
> it is similar to quick sort....
>
>
> On Mon, Nov 5, 2012 at 9:15 PM, rahul sharma <rahul23111...@gmail.com>wrote:
>
>> dude n for build tree and n in this for finding maximun??so n*(n/2)=o(n^2)
>>
>> On Mon, Nov 5, 2012 at 8:54 PM, shady <sinv...@gmail.com> wrote:
>>
>>> Here the time complexity of the solution should be O(n * log(n))....
>>> http://www.geeksforgeeks.org/archives/21781
>>>
>>> --
>>> 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.
>>>
>>
>>  --
>> 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.
>>
>
>  --
> 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.
>

-- 
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.

Reply via email to