PIbd-21. Rodionov I.A. Lab work 03 #4

Closed
ILRodionov wants to merge 2 commits from lab3 into lab2
Showing only changes of commit ba9a4d66ce - Show all commits

View File

@ -1,4 +1,6 @@
namespace ProjectMonorail.Generics
using System.Numerics;
namespace ProjectMonorail.Generics
{
/// <summary>
/// Параметризованный набор объектов
@ -32,24 +34,7 @@
/// <returns></returns>
public int Insert(T monorail)
{
int nullIndex = -1, i;
for (i = 0; i < Count; i++)
{
if (_places[i] == null)
{
nullIndex = i;
break;
}
}
if (nullIndex < 0)
return -1;
for (i = nullIndex; i > 0; i--)
{
_places[i] = _places[i - 1];
}
_places[0] = monorail;
return 0;
return Insert(monorail, 0);
}
/// <summary>