上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 18 下一页
摘要: 设计模式总结 设计模式(Design Patterns)是可复用面向对象软件的基础,是一套被反复使用、多数人知晓的、经过分类编目的、代码设计经验的总结。使用设计模式是为了可重用代码,让代码更容易被他人理解、保证代码可靠性。 毫无疑问,设计模式于己于他人于系统都是多赢的,设计模式使代码编制真正工程化, 阅读全文
posted @ 2015-07-31 20:35 Pickle 阅读(1919) 评论(1) 推荐(1) 编辑
摘要: 组合模式(Composite Pattern)组合模式,将对象组合成树形结构以表示“部分-整体”的层次结构,组合模式使得用户对单个对象和组合对象的使用具有一致性。有时候又叫做部分-整体模式,它使我们树型结构的问题中,模糊了简单元素和复杂元素的概念,客户程序可以像处理简单元素一样来处理复杂元素,从而... 阅读全文
posted @ 2015-07-31 17:02 Pickle 阅读(401) 评论(0) 推荐(0) 编辑
摘要: Description:Implement the following operations of a queue using stacks.push(x) -- Push element x to the back of queue.pop() -- Removes the element fro... 阅读全文
posted @ 2015-07-30 09:35 Pickle 阅读(202) 评论(0) 推荐(0) 编辑
摘要: Description:Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed the linked list is 1 ... 阅读全文
posted @ 2015-07-29 21:18 Pickle 阅读(174) 评论(0) 推荐(0) 编辑
摘要: Description:Write a SQL query to find all numbers that appear at least three times consecutively.+----+-----+| Id | Num |+----+-----+| 1 | 1 || 2 ... 阅读全文
posted @ 2015-07-10 00:20 Pickle 阅读(251) 评论(0) 推荐(0) 编辑
摘要: Description:Given an integer, write a function to determine if it is a power of two.public class Solution { public boolean isPowerOfTwo(int n) { ... 阅读全文
posted @ 2015-07-06 11:45 Pickle 阅读(200) 评论(0) 推荐(0) 编辑
摘要: Description:Implement a basic calculator to evaluate a simple expression string.The expression string contains only non-negative integers, +, -, *, / ... 阅读全文
posted @ 2015-07-01 23:32 Pickle 阅读(184) 评论(0) 推荐(0) 编辑
摘要: Description:Implement a basic calculator to evaluate a simple expression string.The expression string may contain open ( and closing parentheses ), th... 阅读全文
posted @ 2015-07-01 23:28 Pickle 阅读(175) 评论(0) 推荐(0) 编辑
摘要: Description:Implement int sqrt(int x).Compute and return the square root of x.好好学习数学还是非常有用的,牛顿迭代法 求解。 计算x2= n的解,令f(x)=x2-n,相当于求解f(x)=0的解,如左图所示。 首先取x0,... 阅读全文
posted @ 2015-06-29 00:10 Pickle 阅读(172) 评论(0) 推荐(0) 编辑
摘要: Description:Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Calling next() will r... 阅读全文
posted @ 2015-06-28 23:54 Pickle 阅读(200) 评论(0) 推荐(0) 编辑
摘要: Description:Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must b... 阅读全文
posted @ 2015-06-28 00:47 Pickle 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 超时了,只能先这么干了。return Math.pow(x, n); 阅读全文
posted @ 2015-06-28 00:16 Pickle 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Description: Given an array of integers, every element appears three times except for one. Find that single one.只有一个出现一次的数字,其他的都出现了3次,找出出现一次的那个数字。pub... 阅读全文
posted @ 2015-06-27 23:36 Pickle 阅读(142) 评论(0) 推荐(0) 编辑
摘要: Description:Given a sorted integer array without duplicates, return the summary of its ranges.For example, given [0,1,2,4,5,7], return ["0->2","4->5",... 阅读全文
posted @ 2015-06-27 00:08 Pickle 阅读(209) 评论(0) 推荐(0) 编辑
摘要: Description:Given a list of non negative integers, arrange them such that they form the largest number.For example, given [3, 30, 34, 5, 9], the large... 阅读全文
posted @ 2015-06-26 00:42 Pickle 阅读(191) 评论(0) 推荐(0) 编辑
摘要: Description:Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct eleme... 阅读全文
posted @ 2015-06-25 22:45 Pickle 阅读(191) 评论(0) 推荐(0) 编辑
摘要: Description:Implement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the... 阅读全文
posted @ 2015-06-25 00:18 Pickle 阅读(222) 评论(0) 推荐(0) 编辑
摘要: Description:Given an array of integers, every element appears twice except for one. Find that single one.找出只出现一次的数。public class Solution { public i... 阅读全文
posted @ 2015-06-24 23:06 Pickle 阅读(177) 评论(0) 推荐(0) 编辑
摘要: Description:https://leetcode.com/problems/rectangle-area/public class Solution { public int computeArea(int A, int B, int C, int D, int E, int F, i... 阅读全文
posted @ 2015-06-24 00:50 Pickle 阅读(214) 评论(0) 推荐(0) 编辑
摘要: Description:Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any posi... 阅读全文
posted @ 2015-06-24 00:33 Pickle 阅读(182) 评论(0) 推荐(0) 编辑
摘要: Description:You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint... 阅读全文
posted @ 2015-06-23 23:57 Pickle 阅读(189) 评论(0) 推荐(0) 编辑
摘要: Description:Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A... 阅读全文
posted @ 2015-06-19 23:11 Pickle 阅读(180) 评论(0) 推荐(0) 编辑
摘要: Description:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example, "A man, a plan, ... 阅读全文
posted @ 2015-06-19 22:48 Pickle 阅读(167) 评论(0) 推荐(0) 编辑
摘要: Description:Given an index k, return the kth row of the Pascal's triangle.For example, given k = 3, Return [1,3,3,1].public class Solution { public... 阅读全文
posted @ 2015-06-19 21:53 Pickle 阅读(198) 评论(0) 推荐(0) 编辑
摘要: Description:Given numRows, generate the first numRows of Pascal's triangle.For example, given numRows = 5, Return[ [1], [1,1], [1,2,1], [1,3... 阅读全文
posted @ 2015-06-19 21:42 Pickle 阅读(173) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 18 下一页