11 2016 档案

摘要: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 阅读(179) 评论(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 阅读(110) 评论(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 阅读(157) 评论(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 阅读(140) 评论(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 阅读(181) 评论(0) 推荐(0)
摘要:Construct Binary Tree from Inorder and Postorder Traversal Given inorder and postorder traversal of a tree, construct the binary tree. 根据后序遍历和中序遍历构建一棵 阅读全文
posted @ 2016-11-12 15:09 WillWu 阅读(165) 评论(0) 推荐(0)
摘要:Construct Binary Tree from Preorder and Inorder Traversal Given preorder and inorder traversal of a tree, construct the binary tree. 分析: 根据前序遍历和中序遍历构造 阅读全文
posted @ 2016-11-12 15:01 WillWu 阅读(170) 评论(0) 推荐(0)
摘要:Validate Binary Search Tree Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left sub 阅读全文
posted @ 2016-11-12 12:27 WillWu 阅读(134) 评论(0) 推荐(0)
摘要:Longest Valid Parentheses Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses su 阅读全文
posted @ 2016-11-07 12:17 WillWu 阅读(168) 评论(0) 推荐(0)