[Глава 4] Упражнения 1-4

This commit is contained in:
Пытков Роман
2025-07-26 17:46:42 +03:00
parent 1f144231c0
commit 83d5f60fe9
8 changed files with 72 additions and 3 deletions

View File

@@ -0,0 +1,9 @@
static class Task4_2
{
public static int Count<T>(LinkedListNode<T> listNode, int currentLen = 0)
{
if (listNode.Next != null)
return Count(listNode.Next, currentLen + 1);
return currentLen + 1;
}
}