I'm kind of lost here as I do not know how to proceed. Here's what I got so far:
//T[] tab initialised earlier with T elements)
public bool Delete(T element)
{
var find = Array.FindIndex(tab, x => x.CompareTo(element) == 0);
if (find == -1) // if item not found then don't do anything
{
return false;
}
else
{
tab.Remove(element); // can't use Remove with
return true;
}
}
Given Error:
Error 1 'System.Array' does not contain a definition for 'Remove' and no extension method 'Remove' accepting a first argument of type 'System.Array' could be found