public static IEnumerable<int> SomeMethod<T>(this IEnumerable<T> list, Func<T, int> someAction, int percentline)
{
IEnumerable<T> count = list.OrderByDescending(someAction).Take((int)(list.Count() * percentline / 100.0f));
try
{
if (list.Count() <= 100 && list.Count() >= 1)
{
//IEnumerable<T> count = list.OrderByDescending(someAction).Take((int)(list.Count() * percentline / 100.0f));
_ = count;
Console.WriteLine("Перечень элементов: \n" + string.Join("\n", count));
}
else
{
throw new ArgumentException();
}
}
catch (ArgumentException)
{
Console.Write("ОШИБКА!!!\n");
}
//return (IEnumerable<int>)list;
return count(T);
}
public static IEnumerable<int> ExtensionMethod<T>(this IEnumerable<T> list, Func<T, int> someAction, int percentline)
{
try
{
if (list.Count() <= 100 && list.Count() >= 1)
{
IEnumerable<T> count = list.OrderByDescending(someAction).Take((int)(list.Count() * percentline / 100.0f));
Console.WriteLine("Перечень элементов: \n" + string.Join("\n", count));
}
else
{
throw new ArgumentException();
}
}
catch (ArgumentException)
{
Console.Write("ОШИБКА!!!\n");
}
// ошибка... как поправить?
return (IEnumerable<int>)list;
}
public void Search(Node value)
{
if (_root.Salary.Equals(value))
{
if (_root.Left != null)
return;
}
else
{
if (_root.Right != null)
return;
}
}