摘要: 题目如下: Given a non-empty binary tree, find the maximum path sum. For this problem, a path is defined as any sequence of nodes from some starting node t 阅读全文
posted @ 2019-03-18 22:41 seyjs 阅读(114) 评论(0) 推荐(0)
摘要: 题目如下: Sort a linked list in O(n log n) time using constant space complexity. Example 1: Example 2: 解题思路:因为题目要求时间复杂度是O(nlogn),所以快排应该是合适的方法。原理也和快速排序差不多, 阅读全文
posted @ 2019-03-18 16:21 seyjs 阅读(127) 评论(0) 推荐(0)