/*
         * Groups binary numbers based on 1's.
         * Stores group in a hashtable associated with a list (bucket) for each group.
         */
        private static ImplicantGroup Group(ImplicantCollection implicants)
        {
            ImplicantGroup group = new ImplicantGroup();

            foreach (Implicant m in implicants)
            {
                int count = GetOneCount(m.Mask);

                if (!group.ContainsKey(count))
                {
                    group.Add(count, new ImplicantCollection());
                }

                group[count].Add(m);
            }

            return(group);
        }