上一页 1 2 3 4 5 6 7 8 9 10 ··· 13 下一页
摘要: Given a stringsand a dictionary of wordsdict, determine ifscan be segmented into a space-separated sequence of one or more dictionary words.For exampl... 阅读全文
posted @ 2015-03-22 12:03 mrpod2g 阅读(114) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, every element appearsthreetimes except for one. Find that single one.public class Solution { public int singleNumber(in... 阅读全文
posted @ 2015-03-22 11:24 mrpod2g 阅读(90) 评论(0) 推荐(0) 编辑
摘要: Follow upfor "Find Minimum in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Suppose a sort... 阅读全文
posted @ 2015-03-19 13:51 mrpod2g 阅读(94) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, every element appearstwiceexcept for one. Find that single one.public class Solution { public int singleNumber(int[] A)... 阅读全文
posted @ 2015-03-19 13:40 mrpod2g 阅读(108) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull./** * Definition for singly-linked list. * class ListNod... 阅读全文
posted @ 2015-03-18 11:48 mrpod2g 阅读(75) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, determine if it has a cycle in it.判断某个链表是否有环。方法一:用一个hashmap来存放访问过的节点,通过比较当前节点是否存在map中来判断是否有环:/** * Definition for singly-linked l... 阅读全文
posted @ 2015-03-17 19:25 mrpod2g 阅读(105) 评论(0) 推荐(0) 编辑
摘要: Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array[2,3,-2,4],the... 阅读全文
posted @ 2015-03-17 15:32 mrpod2g 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 1.把二元查找树转变成排序的双向链表(树)题目:输入一棵二元查找树,将该二元查找树转换成一个排序的双向链表。要求不能创建任何新的结点,只调整指针的指向。10/ /6 14/ / / /4 8 12 16转换成双向链表4=6=8=10=12=14=16。首先我们定义的二元查找树 节点的数据结构如下:s... 阅读全文
posted @ 2015-03-17 14:18 mrpod2g 阅读(251) 评论(0) 推荐(0) 编辑
摘要: Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2).Find the minimum element.You m... 阅读全文
posted @ 2015-03-16 22:23 mrpod2g 阅读(84) 评论(0) 推荐(0) 编辑
摘要: Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array[−2,1,−3,4,−1,2,1,... 阅读全文
posted @ 2015-03-15 12:45 mrpod2g 阅读(88) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 13 下一页