Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf138da7

Browse files
committed
create csharp/0203-remove-linked-list-elements.cs
1 parent9014b37 commitf138da7

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
publicclassSolution
2+
{
3+
publicListNodeRemoveElements(ListNodehead,intval)
4+
{
5+
ListNodedummy=newListNode(0,head);
6+
ListNodecurrent=dummy;
7+
8+
while(current.nextis notnull)
9+
{
10+
if(current.next.val==val)
11+
{
12+
current.next=current.next.next;
13+
}
14+
else
15+
{
16+
current=current.next;
17+
}
18+
}
19+
returndummy.next;
20+
}
21+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp