コード例 #1
0
ファイル: GroupMinActor.cs プロジェクト: gowthamk/broomc
        public T RemoveAtAndGet(int index)
        {
            if (index > this.Count)
            {
                throw new InvalidOperationException("Insufficient elements");
            }

            ListEntry <T> current  = _head;
            ListEntry <T> previous = null;

            for (int count = 0; count < index; count++)
            {
                previous = current;
                current  = current.Tail;
            }

            var deleted = current;

            previous.Extend(current.Tail);
            _count--;
            return(deleted.Element);
        }
コード例 #2
0
ファイル: GroupMinActor.cs プロジェクト: gowthamk/broomc
 public void Extend(ListEntry <T> tail)
 {
     _tail = tail;
 }
コード例 #3
0
ファイル: GroupMinActor.cs プロジェクト: gowthamk/broomc
 public ListEntry(Region region, T element)
 {
     _element = element;
     _tail    = null;
 }