摘要:
https://leetcode.com/problems/binary-tree-postorder-traversal/description/ Description Implement an iterative, post-order traversal of a given binary 阅读全文
摘要:
https://leetcode.com/problems/sort-list/description/Sort a linked list in O(n log n) time using constant space complexity.找到中点之后的处理,和 143 "Reorder List" 是一样的 : 然后把tail 传后面去 ListNode tail = mid.next ;/... 阅读全文
摘要:
https://leetcode.com/problems/intersection-of-two-arrays/description/Given two arrays, write a function to compute their intersection.Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2].Not... 阅读全文
摘要:
https://leetcode.com/problems/reorder-list/description/Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes' values.... 阅读全文
摘要:
https://leetcode.com/problems/find-peak-element/description/A peak element is an element that is greater than its neighbors.Given an input array where num[i] ≠ num[i+1], find a peak element and return... 阅读全文
摘要:
Given a 2D matrix that contains integers only, which each row is sorted in an ascending order. The first element of next row is larger than (or equal 阅读全文
摘要:
Given a target integer T and an integer array A sorted in ascending order, find the index i in A such that A[i] is closest to T. Assumptions There can 阅读全文