D
Size: a a a
D
D
public IEnumerable<T> ShowList<T>() where T : class
{
if (count == 0)
{
throw new Exception("The List is empty");
}
else
{
while (head.Next != null)
{
yield return head.Data;
}
}
}
Ꮓ
D
D
Ꮓ
Ꮓ
Ꮓ
D
D
D
D
D
Ꮓ
public T[] ShowList()
{
if (count == 0)
{
throw new Exception("The List is empty");
}
else
{
Node<T> current = head;
T[] result = new T[count];
for (int i = 0; i < count; ++i)
{
result[i] = current.Data;
current = current.Next;
}
return result;
}
}
Ꮓ
D
GF
public T[] ShowList()
{
if (count == 0)
{
throw new Exception("The List is empty");
}
else
{
Node<T> current = head;
T[] result = new T[count];
for (int i = 0; i < count; ++i)
{
result[i] = current.Data;
current = current.Next;
}
return result;
}
}
Ꮓ
GF
Ꮓ