/** 数组转链表 **/ public static ListNode parse(int[]head){ ListNode dummy=new ListNode(-1); ListNode cur=dummy; for (int i = 0; i <head.length ; i++) { ListNode node=new ListNode(head[i]); cur.next=node; cur=cur.next; } return dummy.next; }
leetcode数组转链表
最新推荐文章于 2024-05-18 15:56:15 发布