mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-03 05:27:55 +08:00
Update the access() function of linked_list
This commit is contained in:
@ -39,9 +39,9 @@ namespace hello_algo.chapter_array_and_linkedlist
|
||||
{
|
||||
for (int i = 0; i < index; i++)
|
||||
{
|
||||
head = head.next;
|
||||
if (head == null)
|
||||
return null;
|
||||
head = head.next;
|
||||
}
|
||||
return head;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user