Пример #1
0
        private ColumnNode ChooseNextColumn()
        {
            Contract.Assume(!(_root is null));

            int size       = int.MaxValue;
            var nextColumn = new ColumnNode(-1);
            var j          = _root.Right.Column;

            while (j != _root)
            {
                Contract.Assert(!(j is null));

                if (j.Size < size)
                {
                    nextColumn = j;
                    size       = j.Size;
                }

                j = j.Right.Column;
            }
            return(nextColumn);
        }
Пример #2
0
 public DancingLink(ColumnNode root) => Root = root;