摘要: Permutations Given a collection of distinct numbers, return all possible permutations. For example,[1,2,3] have the following permutations 分析: 全排列实现思想 阅读全文
posted @ 2016-12-27 21:41 WillWu 阅读(170) 评论(0) 推荐(0) 编辑
摘要: Remove Duplicates from Sorted List II Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the 阅读全文
posted @ 2016-12-06 23:30 WillWu 阅读(182) 评论(0) 推荐(0) 编辑
摘要: Reverse Nodes in k-Group Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If the number of nodes is n 阅读全文
posted @ 2016-12-05 23:16 WillWu 阅读(176) 评论(0) 推荐(0) 编辑
摘要: Swap Nodes in Pairs Given a linked list, swap every two adjacent nodes and return its head. For example,Given 1->2->3->4, you should return the list a 阅读全文
posted @ 2016-12-05 20:42 WillWu 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 经常对一幅图像进行旋转操作,OpenCV中提供了很方便易用的仿射变换函数warpAffine, 通过getRotationMatrix2D可以得到放射变换矩阵(矩阵大小2x3) 效果 原图 旋转后的图片 阅读全文
posted @ 2016-12-05 13:59 WillWu 阅读(16206) 评论(2) 推荐(2) 编辑
摘要: Decode Ways A message containing letters from A-Z is being encoded to numbers using the following mapping: Given an encoded message containing digits, 阅读全文
posted @ 2016-11-21 21:02 WillWu 阅读(172) 评论(0) 推荐(0) 编辑
摘要: Edit Distance Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 st 阅读全文
posted @ 2016-11-21 20:30 WillWu 阅读(102) 评论(0) 推荐(0) 编辑
摘要: Merge k Sorted Lists Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 根据k个已经排好序的链表构造一个排序的链表,采用类似归并排序 阅读全文
posted @ 2016-11-13 21:22 WillWu 阅读(151) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. 分析: 根据一个有序链表,得到一个平衡二叉搜索树,主要是根据快慢指针得到链表的中 阅读全文
posted @ 2016-11-12 21:08 WillWu 阅读(137) 评论(0) 推荐(0) 编辑
摘要: Path Sum II Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. For example:Given the below binary 阅读全文
posted @ 2016-11-12 20:01 WillWu 阅读(170) 评论(0) 推荐(0) 编辑