摘要:
148. Sort List 题目:Sort a linked list in O(n log n) time using constant space complexity. 题意:排序链表 思路I:merge sort 复杂度分析:时间复杂度O(nlgn),空间复杂度O(1) 1 /** 2 * 阅读全文
摘要:
随时补充 Remove Substrings Given a string s and a set of n substrings. You are supposed to remove every instance of those n substrings from s so that s is 阅读全文
摘要:
Advanced Data Structure -- Union Find Number of Islands Given a boolean 2D matrix, 0 is represented as the sea, 1 is represented as the island. If two 阅读全文
摘要:
310. Minimum Height Trees For a undirected graph with tree characteristics, we can choose any node as the root. The result graph is then a rooted tree 阅读全文