Код: Выделить всё
public List auto_complition(string word)
{
var item = find_word(word);
if (item != null)
{
return auto_complition(item, word, new List());
}
return new List { word };
}
private List auto_complition(Node item, string word, List words)
{
foreach (var items in item.getchildren())
{
}
return new List { word };
}
public Node find_word(string ch)
{
if (ch == null)
{
return null!;
}
return find_word(root, ch, 0);
}
private Node find_word(Node root, string ch, int index)
{
foreach (var item in root.getchildren())
{
if (item.value == ch[index] && index != ch.Length - 1)
{
if (index == ch.Length && item.isendofword)
{
return item;
}
find_word(item, ch, index + 1);
}
}
return null!;
}
Код серьезности Описание Состояние подавления строки файла проекта
Ошибка (активная) CS0050 Непоследовательная доступность: тип возвращаемого значения «Tries.Node» менее доступен, чем метод «Tries.find_word(string)» ConsoleApp1 D:\folder1\ConsoleApp1\Tries.cs 167
Подробнее здесь: https://stackoverflow.com/questions/791 ... n-method-m