10 2018 档案
摘要:Reverse a singly linked list. Example: Follow up: A linked list can be reversed either iteratively or recursively. Could you implement both? 反转单链表,看到我
阅读全文
摘要:Given a linked list, swap every two adjacent nodes and return its head. Example: Note: Your algorithm should use only constant extra space. You may no
阅读全文
摘要:Given an integer array, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be
阅读全文
摘要:You are given a binary tree in which each node contains an integer value. Find the number of paths that sum to a given value. The path does not need t
阅读全文
摘要:Given an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equals to k. Example 1: Note: 解法一:利用s
阅读全文
摘要:Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Note: Do not modify the linked list. Follow up:Can you
阅读全文
摘要:Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space? 经典问题,判断一个单向链表是否有环,快慢指针,有相遇即有环。
阅读全文