Готовая 4 лабораторная работа
This commit is contained in:
parent
f57496c459
commit
052b9929c1
@ -18,7 +18,14 @@ namespace HoistingCrane.CollectionGenericObjects
|
||||
{
|
||||
if (value > 0)
|
||||
{
|
||||
arr = new T?[value];
|
||||
if (arr.Length > 0)
|
||||
{
|
||||
Array.Resize(ref arr, value);
|
||||
}
|
||||
else
|
||||
{
|
||||
arr = new T?[value];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -33,14 +40,7 @@ namespace HoistingCrane.CollectionGenericObjects
|
||||
|
||||
public int Insert(T obj)
|
||||
{
|
||||
for (int i = 0; i < Count; i++)
|
||||
{
|
||||
if (arr[i] == null)
|
||||
{
|
||||
return Insert(obj, 0);
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
return Insert(obj, 0);
|
||||
}
|
||||
|
||||
public int Insert(T obj, int position)
|
||||
|
Loading…
Reference in New Issue
Block a user