@shiv narayan: we are not going to create exact tree as original. You have
to build full binary tree where as original tree may / may not be full
binary tree.
On Wed, Aug 8, 2012 at 2:31 AM, shiv narayan wrote:
> Preorder and postorder do not uniquely define a binary tree.
> so question is vague
Anyone has any hint ?
On Mon, Aug 6, 2012 at 11:32 PM, Subhransu wrote:
> As this might be discussed many times in this thread but cant able to
> trace back the archived emails, so reiterating
>
> If i have to design a elevator system(for simplicity let's say 6 elevator),
> 1. How will be my *cl
Preorder and postorder do not uniquely define a binary tree.
so question is vague .
On Sunday, 15 July 2012 01:41:15 UTC+5:30, Navin Kumar wrote:
>
> Given Preorder and postorder traversals of a tree. Device an algorithm to
> constuct a fully binary tree from these traversals.
--
You received t
Preorder and postorder do not uniquely define a binary tree.
so question is vague .
On Sunday, 15 July 2012 01:41:15 UTC+5:30, Navin Kumar wrote:
>
> Given Preorder and postorder traversals of a tree. Device an algorithm to
> constuct a fully binary tree from these traversals.
--
You received t
1. Convert your Binary tree into doubly linked list.
2. Sort the linked list using merge sort
3. Build BST using doubly linked list by each time selecting middle node
and recursively calling left part of linked list and right part of linked
list.
On Tue, Aug 7, 2012 at 10:23 PM, vaibhav shukla wro
Can u please explain the algorithm. is n't inorder always needed to
construct a unique tree?
On Sunday, July 15, 2012 1:41:15 AM UTC+5:30, Navin Kumar wrote:
>
> Given Preorder and postorder traversals of a tree. Device an algorithm to
> constuct a fully binary tree from these traversals.
--
Y
Hi all
The problem is to convert a binary tree into Binary Search Tree
My approach was :
1. Store the Inorder traversal of BT in an array.
2. Sort the array in ascending order.
3. Again do inorder traversal and write the Node's data from array one by
one.
This approach takes O(n) extra space.
The problem boils down to this:
http://www.geeksforgeeks.org/archives/6463
On Tue, Aug 7, 2012 at 1:59 PM, manish patel wrote:
> This is maximum sub-array problem. Nice explaination is given in CLRS -
> "Introduction to algorithms " Pg 68, ch-4 3rd edition
>
>
> On Tue, Aug 7, 2012 at 11:00 AM,
check dis link
http://www.1771.in/how-many-comparisons-are-needed-in-worst-case-if-we-have-to-sort-7-numbers-each-of-4-digit.html
On Tue, Aug 7, 2012 at 9:38 PM, Sambhavna Singh wrote:
> Its radix sort..
>
>
> On Fri, Aug 3, 2012 at 4:39 PM, Navin Gupta wrote:
>
>> I think the no. of comparison
Its radix sort..
On Fri, Aug 3, 2012 at 4:39 PM, Navin Gupta wrote:
> I think the no. of comparisons depend upon the type of sorting used.
> Please specify the sorting algorithm used:-
> 1:- in case of bubble sort it is - 21
> 2:- in case of radix sort it is - 84
>
>
>
> On Tuesday, 31 July 201
This is maximum sub-array problem. Nice explaination is given in CLRS -
"Introduction to algorithms " Pg 68, ch-4 3rd edition
On Tue, Aug 7, 2012 at 11:00 AM, Navin Gupta wrote:
> @ashgoel :- Thanx for pointing it out, my earlier approach doesn't work.
> Please check if this works.
> We can appl
@ashgoel :- Thanx for pointing it out, my earlier approach doesn't work.
Please check if this works.
We can apply this:-
For every element, find the highest element to the right of it.
For e.g:
I/P:- 35 4015 35 10 20
Highest to Right:- 40 3535 20
12 matches
Mail list logo