随笔分类 -  Algorithm

摘要:Given a strings, cutsinto some substrings such that every substring is a palindrome.Return the minimum cuts needed for a palindrome partitioning ofs.E... 阅读全文
posted @ 2015-10-09 10:25 xchangcheng 阅读(119) 评论(0) 推荐(0)
摘要:Givennxmnon-negative integers representing an elevation map 2d where the area of each cell is1x1, compute how much water it is able to trap after rain... 阅读全文
posted @ 2015-10-07 13:10 xchangcheng 阅读(160) 评论(0) 推荐(0)
摘要:Givennnon-negative integers representing an elevation map where the width of each bar is1, compute how much water it is able to trap after raining.Exa... 阅读全文
posted @ 2015-10-07 13:09 xchangcheng 阅读(202) 评论(0) 推荐(0)
摘要:Given a permutation which contains no repeated number, find its index in all the permutations of these numbers, which are ordered in lexicographical o... 阅读全文
posted @ 2015-10-05 13:26 xchangcheng 阅读(191) 评论(0) 推荐(0)
摘要:Given a string s and a dictionary of words dict, determine if s can be break into a space-separated sequence of one or more dictionary words.ExampleGi... 阅读全文
posted @ 2015-10-04 10:48 xchangcheng 阅读(190) 评论(0) 推荐(0)
摘要:Given an array with positive and negative integers. Re-range it to interleaving with positive and negative integers.ExampleGiven[-1, -2, -3, 4, 5, 6],... 阅读全文
posted @ 2015-09-09 09:42 xchangcheng 阅读(198) 评论(0) 推荐(0)
摘要:Find the number Weak Connected Component in the directed graph. Each node in the graph contains a label and a list of its neighbors. (a connected set ... 阅读全文
posted @ 2015-09-01 19:36 xchangcheng 阅读(202) 评论(0) 推荐(0)
摘要:Design an algorithm and write code to serialize and deserialize a binary tree. Writing the tree to a file is called 'serialization' and reading back f... 阅读全文
posted @ 2015-08-27 17:31 xchangcheng 阅读(174) 评论(0) 推荐(0)
摘要:Given an integer array, find a continuous rotate subarray where the sum of numbers is the biggest. Your code should return the index of the first numb... 阅读全文
posted @ 2015-08-27 16:19 xchangcheng 阅读(639) 评论(0) 推荐(0)
摘要:Determine the number of bits required to flip if you want to convert integernto integerm.ExampleGivenn=31(11111),m=14(01110), return2.NoteBothnandmare... 阅读全文
posted @ 2015-08-15 10:04 xchangcheng 阅读(188) 评论(0) 推荐(0)
摘要:Count how many1in binary representation of a 32-bit integer.ExampleGiven32, return1Given5, return2Given1023, return9ChallengeIf the integer isnbits wi... 阅读全文
posted @ 2015-08-15 09:57 xchangcheng 阅读(195) 评论(0) 推荐(0)
摘要:C#提供一种机制,使程序员可以使用含有XML文本的特殊注释语法为他们的代码编写文档。在源代码文件中,具有某种格式的注释可用于指导某个工具根据这些注释和它们后面的源代码元素生成XML。使用这类语法的注释称为文档注释(documentation comment)。这些注释后面必须紧跟用户定义类型(如类、委托或接口)或者成员(如字段、事件、属性或方法)。XML生成工具称作文档生成器(documentation generator)。(此生成器可以但不一定必须是C#编译器本身。)由文档生成器产生的输出称为文档文件(documentation file)。文档文件可作为文档查看器(documentati 阅读全文
posted @ 2012-08-29 15:45 xchangcheng 阅读(277) 评论(0) 推荐(0)