Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AAD.Tests/AAD.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down
2 changes: 1 addition & 1 deletion AAD/AAD.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
22 changes: 20 additions & 2 deletions AAD/LnkList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public static LnkList<T> From(params T[] values)
private LnkNode<T>? _last;

private int _count;
private LnkNode<T>? node;

public LnkList() : this(head: null, last: null)
{
Expand All @@ -37,7 +38,7 @@ public void Add(T element)
_head = _last = newNode;
else // O(1)
{
_last.Next = newNode;
_last!.Next = newNode;
_last = newNode;
}

Expand Down Expand Up @@ -97,4 +98,21 @@ public T[] ToArray()

return result.ToArray();
}
}

// Método que devuelve el nivel del nodo en la lista
public int Level() {

int level = 0;

LnkNode<T> current = _head!;

while (current != node) {

level++;

current = current.Next!;
}

return level;
}
}
2 changes: 1 addition & 1 deletion RandomStudent/RandomStudent.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down