Cow Pedegree

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Cow Pedegree as PDF for free.

More details

  • Words: 227
  • Pages: 1
********************************************************************** cow pedigrees silviu ganceanu -- 2003 farmer mother easily nodes.

john is considering purchasing a new herd of cows. in this new herd, each cow gives birth to two children. the relationships among the cows can be represented by one or more binary trees with a total of n (3 <= n < 200) the trees have these properties:

the degree of each node is 0 or 2. the degree is the count of the node's immediate children. the height of the tree is equal to k (1 < k <100). the height is the number of nodes on the longest path from the root to any leaf; a leaf is a node with no children. how many different possible pedigree structures are there? a pedigree is different if its tree structure differs from that of another pedigree. output the remainder when the total number of different possible pedigrees is divided by 9901. program name: nocows input format line 1: two space-separated integers, n and k. sample input (file nocows.in) 5 3 output format line 1: one single integer number representing the number of possible pedigrees modulo 9901. sample output (file nocows.out) 2 output details: two possible pedigrees have 5 nodes and height equal to 3: @ @ / \ / \ @ @ and @ @ / \ / \ @ @ @ @

**********************************************************************

Related Documents

Cow Pedegree
November 2019 11
Pedegree
December 2019 11
Cow 1.6
May 2020 17
The Cow
April 2020 5
Cow 1.4
June 2020 9
Cow 2.2
June 2020 4