Example #1
0
        static void Main(string[] args)
        {
            string variables = Console.ReadLine();

            string[] tokens = variables.Split(' ');
            int      n      = int.Parse(tokens[0]); //number of ceiling prototypes
            int      k      = int.Parse(tokens[1]); //number of layers

            List <BST> shapes = new List <BST>();

            for (int i = 0; i < n; i++)
            {
                string   data    = Console.ReadLine();
                string[] values  = data.Split(' ');
                BST      newTree = new BST();
                for (int x = 0; x < k; x++)
                {
                    newTree.add(int.Parse(values[x]));
                }
                bool shapeExists = false;
                foreach (BST tree in shapes)
                {
                    if (newTree.isSameShape(tree))
                    {
                        shapeExists = true;
                    }
                }
                if (!shapeExists)
                {
                    shapes.Add(newTree);
                }
            }

            Console.Out.WriteLine(shapes.Count);
            //Console.Read();
        }
Example #2
0
 public bool isSameShape(BST other)
 {
     return(areSameShape(this.root, other.root));
 }