摘要:
问题: 来源:https://leetcode.com/problems/simplify-path Given an absolute path for a file (Unix-style), simplify it. For example,path = "/home/", => "/home 阅读全文
摘要:
来源:https://leetcode.com/problems/sort-list Sort a linked list in O(n log n) time using constant space complexity. 归并排序(Merge Sort,台湾译作:合并排序)是建立在归并操作上的 阅读全文
摘要:
来源:https://leetcode.com/problems/sort-colors Given an array with n objects colored red, white or blue, sort them so that objects of the same color are 阅读全文
摘要:
来源:https://leetcode.com/problems/insertion-sort-list Sort a linked list using insertion sort. 方法: 1. 使用一个preHead指向头节点,这样在将节点插入头节点前面时(即某个节点值比头节点小)不需要进行 阅读全文
摘要:
来源:https://leetcode.com/problems/intersection-of-two-arrays Given two arrays, write a function to compute their intersection. Example:Given nums1 = [1 阅读全文
摘要:
来源:https://leetcode.com/problems/balanced-binary-tree Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced bin 阅读全文
摘要:
来源:https://leetcode.com/problems/maximum-depth-of-binary-tree Given a binary tree, find its maximum depth. The maximum depth is the number of nodes al 阅读全文
摘要:
来源:https://leetcode.com/problems/binary-tree-level-order-traversal Given a binary tree, return the level order traversal of its nodes' values. (ie, fr 阅读全文