06 2019 档案
摘要:148. Sort List Sort a linked list in O(n log n) time using constant space complexity. Example 1: Example 2:
阅读全文
摘要:147. Insertion Sort List Sort a linked list using insertion sort. A graphical example of insertion sort. The partial sorted list (black) initially con
阅读全文
摘要:146. LRU Cache Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put. get
阅读全文
摘要:145. Binary Tree Postorder Traversal Given a binary tree, return the postorder traversal of its nodes' values. Example: Follow up: Recursive solution
阅读全文
摘要:144. Binary Tree Preorder Traversal Given a binary tree, return the preorder traversal of its nodes' values. Example: Follow up: Recursive solution is
阅读全文
摘要:143. Reorder List Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You may not modify the values in the list's nod
阅读全文
摘要:142. Linked List Cycle II Given a linked list, return the node where the cycle begins. If there is no cycle, return null. To represent a cycle in the
阅读全文
摘要:141. Linked List Cycle Given a linked list, determine if it has a cycle in it. To represent a cycle in the given linked list, we use an integer pos wh
阅读全文
摘要:140. Word Break II Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, add spaces in s to construct a sentence
阅读全文
摘要:首先要清楚类和对象之间的关系,然后要清楚实例化(new)的过程中发生了什么。 笔者认为类和对象的关系比较好理解,就如同要按照图纸盖一幢房子,图纸就是类,房子就是对象。类是对象的抽象,对象是类的实体体现。 new的过程发生了什么呢? var Person=function(name,age){ thi
阅读全文
摘要:139. Word Break Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a spac
阅读全文
摘要:138. Copy List with Random Pointer A linked list is given such that each node contains an additional random pointer which could point to any node in t
阅读全文
摘要:效果: 来源:http://es6.ruanyifeng.com/#docs/set-map
阅读全文