上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 27 下一页
摘要: Binary Tree Upside DownGiven a binary tree where all the right nodes are either leaf nodes with a sibling (a left node that shares the same parent nod... 阅读全文
posted @ 2014-12-29 12:11 陆草纯 阅读(1747) 评论(2) 推荐(0) 编辑
摘要: Excel Sheet Column NumberRelated to questionExcel Sheet Column TitleGiven a column title as appear in an Excel sheet, return its corresponding column ... 阅读全文
posted @ 2014-12-29 10:40 陆草纯 阅读(3911) 评论(0) 推荐(0) 编辑
摘要: Longest Substring with At Most Two Distinct CharactersGiven a string, find the length of the longest substring T that contains at most 2 distinct char... 阅读全文
posted @ 2014-12-28 16:00 陆草纯 阅读(1729) 评论(0) 推荐(0) 编辑
摘要: 1、相同点:回溯法在实现上也是遵循深度优先的,即一步一步往前探索,而不像广度优先那样,由近及远一片一片地扫。2、不同点(1)访问序深度优先遍历: 目的是“遍历”,本质是无序的。也就是说访问次序不重要,重要的是都被访问过了。可以参见题Surrounded Regions,深度优先只需要把从边界起始的... 阅读全文
posted @ 2014-12-27 11:08 陆草纯 阅读(13725) 评论(1) 推荐(2) 编辑
摘要: 1、使用结构体grid作为map的keystruct grid{ int x; int y;};(1)需要自定义比较函数operator &,const std::deque &)”: 未能从“const grid”为“const std::deque &”推导 模板 参数(2)需要定义... 阅读全文
posted @ 2014-12-26 20:59 陆草纯 阅读(3496) 评论(0) 推荐(1) 编辑
摘要: Median of Two Sorted ArraysThere are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run... 阅读全文
posted @ 2014-12-23 17:14 陆草纯 阅读(5466) 评论(0) 推荐(1) 编辑
摘要: Longest Substring Without Repeating CharactersGiven a string, find the length of the longest substring without repeating characters. For example, the ... 阅读全文
posted @ 2014-12-23 13:40 陆草纯 阅读(219) 评论(0) 推荐(0) 编辑
摘要: Add Two NumbersYou are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes co... 阅读全文
posted @ 2014-12-23 11:44 陆草纯 阅读(220) 评论(0) 推荐(0) 编辑
摘要: Longest Palindromic SubstringGiven a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there... 阅读全文
posted @ 2014-12-22 23:33 陆草纯 阅读(244) 评论(0) 推荐(0) 编辑
摘要: ZigZag ConversionThe string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern i... 阅读全文
posted @ 2014-12-22 23:14 陆草纯 阅读(1012) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 27 下一页