The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+3 votes
166 views

PLZ EXPLAIN?

asked in Algorithms by (483 points) | 166 views
0
896 ??
+2
I am also getting same .

$\frac{9!}{\left ( 9\times 5\times3\times3\times1\times1\times1\times1\times1 \right )}$
0
Please explain how this came?
0
can u explain

2 Answers

+4 votes
Best answer

Given Elements : 12,10,8,5,3,2,1,7,9

1) Maximum of all these will be root i.e. Root = 12 ---->1 way --->(1)

2) Remaining : 8 elements

Out of 8 choose 5 for left subtree in 8C5 ways and 3 for right subtree in 3C3 ways. --->(2)

3)Left Subtree :

Out of 5, maximum element is the root.

Out of remaining four , choose 3 for left subtree in 4C3 ways , Out of 3 elements chosen, max is root and rest 2 can be in any of the 2 leaf nodes.

#Heaps possible in Left Subtree= 4C3 * 2 --->(3)

3)Right Subtree :

Out of 3, maximum is root.

Remaining 2 elements can be arranged in 2 leaves in 2 ways.

#Heaps possible in Right Subtree=  2 --->(4)

Hence From (1) to (4) , Total # heaps possible = 1 * ( 8C5 * 4C3 *2 )  * (3C3 * 2 )

=56 * 4 * 2 * 2 =896 (ANS)

answered by Active (1k points)
selected by
–1 vote

ans is 896

answered by Junior (553 points)

Related questions

+2 votes
0 answers
2


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

47,005 questions
51,325 answers
177,509 comments
66,668 users