上一页 1 ··· 28 29 30 31 32 33 34 35 36 ··· 72 下一页
摘要: 一、UML图 二、概念 策略模式:他定义了算法家族,分别封装起来,让他们之间可以互相替换,此模式让算法的变化,不会影响到使用算法的客户。 三、优点 (1)策略模式是一种定义一系列算法的方法,从概念上来看,所有这些算法完成的都是相同的工作,只是实现不同,他可以以相同的方式调用所有的算法,减少了各种算法 阅读全文
posted @ 2018-10-04 15:13 乐乐章 阅读(577) 评论(0) 推荐(0)
摘要: 工厂模式 工厂模式(Factory Pattern)是 Java 中最常用的设计模式之一。这种类型的设计模式属于创建型模式,它提供了一种创建对象的最佳方式。 在工厂模式中,我们在创建对象时不会对客户端暴露创建逻辑,并且是通过使用一个共同的接口来指向新创建的对象。 介绍 意图:定义一个创建对象的接口, 阅读全文
posted @ 2018-10-01 20:16 乐乐章 阅读(450) 评论(0) 推荐(0)
摘要: DescriptionHintsSubmissionsDiscussSolution Pick One Given two non-negative integers num1 and num2 represented as strings, return the product of num1 a 阅读全文
posted @ 2018-08-11 00:29 乐乐章 阅读(170) 评论(0) 推荐(0)
摘要: Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longestpath betwee 阅读全文
posted @ 2018-07-18 22:02 乐乐章 阅读(132) 评论(0) 推荐(0)
摘要: Given an array nums of n integers and an integer target, are there elements a, b, c, and d in nums such that a + b + c + d = target? Find all unique q 阅读全文
posted @ 2018-07-15 17:20 乐乐章 阅读(225) 评论(0) 推荐(0)
摘要: Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. A mapping of digit to le 阅读全文
posted @ 2018-07-15 16:13 乐乐章 阅读(506) 评论(0) 推荐(0)
摘要: Given an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the thr 阅读全文
posted @ 2018-07-15 15:35 乐乐章 阅读(242) 评论(0) 推荐(0)
摘要: Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the s 阅读全文
posted @ 2018-07-11 22:25 乐乐章 阅读(164) 评论(0) 推荐(0)
摘要: Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Exampl 阅读全文
posted @ 2018-07-10 21:49 乐乐章 阅读(175) 评论(0) 推荐(0)
摘要: Implement atoi which converts a string to an integer. The function first discards as many whitespace characters as necessary until the first non-white 阅读全文
posted @ 2018-07-10 21:25 乐乐章 阅读(139) 评论(0) 推荐(0)
上一页 1 ··· 28 29 30 31 32 33 34 35 36 ··· 72 下一页