链表:sth.next 到底指的是什么?

Linked List : What exactly sth.next refers to?

我最近在youtube上看了一系列LinkedList视频,如下图所示:

enter image description here

视频URL:https://www.youtube.com/watch?v=2RwWsHePdr8&index=11&list=PL6Zs6LgrJj3tWQfE6HK4JaX3wN96yhkD3

不,我要删除数字 15(位置 3),所以这里是代码:

if(position ==1) {
                ListNode temp = head;
                head = head.next;
                temp.next = null;
                return temp;
                }else {
                    ListNode previous = head;
                    int count =1;
                    while(count < position -1) {
                        previous = previous.next;
                        count++;
                    }

                    ListNode current = previous.next;
                    previous.next = current.next;
                    current.next = null;
                    return current;
                }

有一个问题让我很困惑:图中:|10|_|--> | 8 | __ | 如果我输入:『head.next』,是否意味着 8 ?还是表示 10 旁边的节点 space?

因为在我透露的代码中,我无法理解:"why the last code is 『current.next = null; 』?" 我认为『current.next』指向数字11?? 如果『current.next』表示15的下一个结点,将之前的代码『previous.next = current.next』改为『previous.next = current.next.next』 ?即『current.next.next』可以参考数字11

提前致谢!!

更新: head.next 和 head.next.next 是这样的意思吗? enter image description here

word next指向下一个节点,由address(系统内存地址)和value(例如15)组成

如果您知道需要删除值为 15 的节点,您可以遍历数组并将此节点的指针 "next" 绑定到节点,即 15 显示在

ListNode temp = head;
while (temp.next != null){
    if (temp.next.value == 15):
        ListNode nodeWithValue15 = temp.next;
        temp.next = nodeWithValue15.next;
        // after rebinding address to your previous node, you can delete node with value 15
        nodeWithValue15 = null;
    temp = temp.next;

Here you can see what next.next does