ISEbd-21 Melnikov I.O. Lab work 03 Base #5

Merged
eegov merged 6 commits from LabWork03 into LabWork02 2022-10-21 10:41:37 +04:00
Showing only changes of commit 38ed0c2a42 - Show all commits

View File

@ -27,6 +27,18 @@
public bool Insert(T locomotive)
{
// TODO проверка на наличие свободных мест
Review

Правильнее было вызвать Insert(T obj, 0);

Правильнее было вызвать Insert(T obj, 0);
T testLocomotive = _places[0];
for (int i = 0; i < Count; i++)
{
if (_places[i] == null)
{
testLocomotive = _places[i];
}
}
if (testLocomotive != null)
{
return false;
}
for (int i = Count - 2; i >= 0; i--)
{
_places[i + 1] = _places[i];