Morozov V.S. LabWork04 #5

Closed
VoldemarProger wants to merge 5 commits from LabWork04 into LabWork03
Showing only changes of commit 98421f8d63 - Show all commits

View File

@ -20,17 +20,13 @@ namespace AirPlaneWithRadar
}
public int Insert(T plain)
{
if (_places.Count == _maxCount)
{
return -1;
}
_places.Insert(0, plain);
Insert(plain, 0);
return _places.Count;
}
public int Insert(T plain, int position)
{
if (position < 0 || _places.Count < position||position > _maxCount)
if (position < 0 || _places.Count < position||position > _maxCount || _places.Count == _maxCount)
return -1;
else if (plain == null)
return -1;