当前位置 博文首页 > 魏小言的博客:剑指offer&leetcode

    魏小言的博客:剑指offer&leetcode

    作者:[db:作者] 时间:2021-06-24 18:13

    链表类

    题库持续更新中…

    一、反转链表

    题目描述 输入一个链表,反转链表后,输出链表的所有元素。

    //反转链表--迭代
    public NodeList reLinkedNode(NodeList head){
       
    	if(head == head || head.next == null){
       
    		return head;
    	}
    	ListNode pre = nu