前端bubucuoReact低代碼項(xiàng)目
部分翻轉(zhuǎn) => prev = ListNode
ListNode prev = xxx;ListNode currentNode = prev.next;while (currentNode != null) {
? ? ListNode temp = currentNode.next;
? ? currentNode.next = temp.next;
? ? temp.next = prev.next;
? ? prev.next = temp;}
public class Demo {
? ?public boolean enoughK(int k, ListNode head) {
? ? ? ?for (int i = 0; i < k; i++) {
? ? ? ? ? ?if (head == null) {
? ? ? ? ? ? ? ?return false;
標(biāo)簽: