400-110=290
动态规划,还有栈
搞定之后,大约是130
还有270道、、一天两道外加上复盘、、
JVM、 ~~~~~~~~~
mysql、
微服务 ~~~~~~~~~~~~~图灵
Spring、、
八股总结、、、、
项目、底层源码、、、、
92、反转链表二
class Solution {
public ListNode reverseBetween(ListNode head, int left, int right) {
if(head==null || head.next==null) return head;
ListNode preHead=new ListNode(-1,head),pre=preHead,cur=head,temp=head,node1=head;
int count=0;
while (cur!=null){
count++;
if(count==left){
node1=cur;
while (count<=right){
temp=cur.next;
cur.next=pre.next;
pre.next=cur;
cur=temp;
count++;
}
node1.next=temp;
if(left==1) return preHead.next;
return head;
}else {
pre=cur;
cur=cur.next;
}
}
return head;
}
}
206. 反转链表
class Solution {
public ListNode reverseList(ListNode head) {
ListNode preHead=new ListNode(-1,null),pre=preHead,cur=head,temp=head;
while (cur!=null){
temp=cur.next;
cur.next=pre.next;
pre.next=cur;
cur=temp;
}
return pre.next;
}
}