natix.CompactDS.SortedList.Add C# (CSharp) Method

Add() public method

public Add ( int p ) : void
p int
return void
        public void Add(int p)
        {
            if (this.sortedList.Count == 0) {
                this.sortedList.Add (p);
                return;
            }
            if (this.sortedList[this.sortedList.Count-1] >= p) {
                throw new ArgumentOutOfRangeException ();
            }
            this.sortedList.Add (p);
            if (p+1 > this.N) {
                this.N = p + 1;
            }
        }