11 2014 档案

摘要:Given an absolute path for a file (Unix-style), simplify it.For example,path="/home/", =>"/home"path="/a/./b/../../c/", =>"/c"算法:根据/把path分割,再逐个判断publi... 阅读全文
posted @ 2014-11-24 22:36 bingtel 阅读(129) 评论(0) 推荐(0)
摘要:Implement pow(x,n).public class Solution { public double pow(double x, int n) { //判断x是不是0 if(Math.abs(x-0)<0.0000001) retu... 阅读全文
posted @ 2014-11-23 19:53 bingtel 阅读(117) 评论(0) 推荐(0)
摘要:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo... 阅读全文
posted @ 2014-11-18 20:23 bingtel 阅读(133) 评论(0) 推荐(0)
摘要:Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Update (2014-11-02):The si... 阅读全文
posted @ 2014-11-17 18:59 bingtel 阅读(130) 评论(0) 推荐(0)
摘要:Given an arraySofnintegers, are there elementsa,b,c, anddinSsuch thata+b+c+d= target? Find all unique quadruplets in the array which gives the sum of ... 阅读全文
posted @ 2014-11-15 20:02 bingtel 阅读(168) 评论(0) 推荐(0)
摘要:Given an arraySofnintegers, find three integers inSsuch that the sum is closest to a given number, target. Return the sum of the three integers. You m... 阅读全文
posted @ 2014-11-15 19:10 bingtel 阅读(141) 评论(0) 推荐(0)
摘要:Given an arraySofnintegers, are there elementsa,b,cinSsuch thata+b+c= 0? Find all unique triplets in the array which gives the sum of zero.Note:Elemen... 阅读全文
posted @ 2014-11-15 18:18 bingtel 阅读(164) 评论(0) 推荐(0)
摘要:Given a linked list, remove thenthnode from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After re... 阅读全文
posted @ 2014-11-13 16:16 bingtel 阅读(137) 评论(0) 推荐(0)
摘要:Given a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater than or equal tox.You should preserve the origi... 阅读全文
posted @ 2014-11-13 13:09 bingtel 阅读(116) 评论(0) 推荐(0)
摘要:Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it without using extra space?算法:... 阅读全文
posted @ 2014-11-12 16:19 bingtel 阅读(152) 评论(0) 推荐(0)
摘要:Given an array withnobjects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, wh... 阅读全文
posted @ 2014-11-12 15:56 bingtel 阅读(135) 评论(0) 推荐(0)
摘要:Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't mat... 阅读全文
posted @ 2014-11-12 14:18 bingtel 阅读(134) 评论(0) 推荐(0)
摘要:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Pana... 阅读全文
posted @ 2014-11-12 14:04 bingtel 阅读(150) 评论(0) 推荐(0)
摘要:Given a list, rotate the list to the right bykplaces, wherekis non-negative.For example:Given1->2->3->4->5->NULLandk=2,return4->5->1->2->3->NULL.为了方便,... 阅读全文
posted @ 2014-11-12 14:01 bingtel 阅读(142) 评论(0) 推荐(0)