Ejemplo n.º 1
0
        public void Add(int num, int start, int size)
        {
            hole nw = new hole(num, start, size);

            if (isEmpty())
            {
                head = nw;
            }
            else
            {
                hole tmp = last();
                tmp.set_next(nw);
            }
        }
Ejemplo n.º 2
0
        public void remove(hole h)
        {
            hole tmp = head;

            if (size() == 1)
            {
                head = null;
                return;
            }
            else if (tmp == h)
            {
                head = tmp.get_next();
                return;
            }
            else
            {
                while (tmp.get_next() != h && tmp.get_next() != null)
                {
                    tmp = tmp.get_next();
                }
                hole tmp2 = tmp.get_next();
                tmp.set_next(tmp2.get_next());
            }
        }