ceiling_function
ceiling_function
BATCH 28
January 28,2023
Team Members:
21B01A0511-B.GLORY-CSE
21B01A0409-B.MADHAVI-ECE
22B01A0443-K.SWETHA KUMARI-ECE
21B01A01O5-B.POOJITHA-CIVIL
21B01A0111-M.PRASANNA-CIVIL
22B05A0101-B.SUJITHA-CIVIL
Problem Statement
▶ Advanced Ceiling Manufacturers (ACM) is analyzing the
properties of its new series of Incredibly Collapse-Proof
Ceilings (ICPCs),An ICPC consists of n layers of material, each
with a different value of collapse resistance.The analysis, ACM
wants to run will take the collapse-resistance values of the
layers, store them in a binary searchtree, and check whether
the shape of this tree in any way correlates with the quality of
the wholeconstruction.
▶ The rules for inserting a value v are:If the tree is empty, make
v the root of the tree.If the tree is not empty, compare v with
the root of the tree, If v is smaller, insert v into the leftsubtree
of the root, otherwise insert v into the right subtree.
▶ if two prototypes induce the same tree shape,ACM will analyze
them together,our task is to determine how many different tree
shapes they induce,Display the number of different tree shapes.
Input
The first line of the input contains two integers n (1 n 50), which
is the number of ceiling prototypes to analyze, and k (1 k 20),
which is the number of layers in each of the prototypes which are
the collapse-resistance values of the layers in a ceiling prototype,
ordered from top to bottom.
Output