摘要: Given an integer n, return 1 - n in lexicographical order. For example, given 13, return: [1,10,11,12,13,2,3,4,5,6,7,8,9]. Please optimize your algori 阅读全文
posted @ 2018-07-08 20:13 小T在学习 阅读(366) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, swap every two adjacent nodes and return its head. Example: Note: Your algorithm should use only constant extra space. You may no 阅读全文
posted @ 2018-07-08 10:50 小T在学习 阅读(449) 评论(0) 推荐(1) 编辑
摘要: Reverse a singly linked list. Example: Follow up: A linked list can be reversed either iteratively or recursively. Could you implement both? 反转链表,链表算法 阅读全文
posted @ 2018-07-08 10:49 小T在学习 阅读(3842) 评论(0) 推荐(1) 编辑
摘要: Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. k is a positive integer and is less than or equal to 阅读全文
posted @ 2018-07-08 10:47 小T在学习 阅读(471) 评论(0) 推荐(0) 编辑
摘要: 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 space-separated sequ 阅读全文
posted @ 2018-07-03 22:12 小T在学习 阅读(1539) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both 阅读全文
posted @ 2018-07-03 11:45 小T在学习 阅读(447) 评论(0) 推荐(0) 编辑
摘要: Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numb 阅读全文
posted @ 2018-07-03 10:32 小T在学习 阅读(1602) 评论(0) 推荐(0) 编辑
摘要: Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique combinations in candidates where the 阅读全文
posted @ 2018-07-03 10:12 小T在学习 阅读(570) 评论(0) 推荐(0) 编辑
摘要: Given an array of citations sorted in ascending order (each citation is a non-negative integer) of a researcher, write a function to compute the resea 阅读全文
posted @ 2018-07-02 17:46 小T在学习 阅读(205) 评论(0) 推荐(0) 编辑
摘要: Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. Example 1: Example 2: 阅读全文
posted @ 2018-07-02 16:47 小T在学习 阅读(312) 评论(0) 推荐(0) 编辑