mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-24 18:55:36 +08:00
1. Remove unused libs.
2. Add file headers. 3. Modify file name to match Java's. 4. Fix some issues.
This commit is contained in:
@ -10,7 +10,7 @@ namespace hello_algo.include
|
||||
public class ListNode
|
||||
{
|
||||
public int val;
|
||||
public ListNode next;
|
||||
public ListNode? next;
|
||||
|
||||
/// <summary>
|
||||
/// Generate a linked list with an array
|
||||
@ -26,7 +26,7 @@ namespace hello_algo.include
|
||||
/// </summary>
|
||||
/// <param name="arr"></param>
|
||||
/// <returns></returns>
|
||||
public static ListNode ArrToLinkedList(int[] arr)
|
||||
public static ListNode? ArrToLinkedList(int[] arr)
|
||||
{
|
||||
ListNode dum = new ListNode(0);
|
||||
ListNode head = dum;
|
||||
@ -44,7 +44,7 @@ namespace hello_algo.include
|
||||
/// <param name="head"></param>
|
||||
/// <param name="val"></param>
|
||||
/// <returns></returns>
|
||||
public static ListNode GetListNode(ListNode head, int val)
|
||||
public static ListNode? GetListNode(ListNode? head, int val)
|
||||
{
|
||||
while (head != null && head.val != val)
|
||||
{
|
||||
|
Reference in New Issue
Block a user