404
-{{ getMsg() }}-
diff --git "a/\350\266\205\346\270\205\346\200\235\347\273\264\345\257\274\345\233\276 100 \345\274\240/42.Java\346\212\200\346\234\257\347\233\270\345\205\263/.DS_Store" b/.DS_Store
similarity index 75%
rename from "\350\266\205\346\270\205\346\200\235\347\273\264\345\257\274\345\233\276 100 \345\274\240/42.Java\346\212\200\346\234\257\347\233\270\345\205\263/.DS_Store"
rename to .DS_Store
index a3d7637e..4cb2147e 100644
Binary files "a/\350\266\205\346\270\205\346\200\235\347\273\264\345\257\274\345\233\276 100 \345\274\240/42.Java\346\212\200\346\234\257\347\233\270\345\205\263/.DS_Store" and b/.DS_Store differ
diff --git a/1.md b/1.md
new file mode 100644
index 00000000..22ee39cf
--- /dev/null
+++ b/1.md
@@ -0,0 +1,32 @@
+##### [点击下载本项目全部内容 提取码:【8f8b】 包括:1、我写的图解算法题典 2、千本开源电子书 3、百张思维导图 4、BAT/TMD 大厂面经 (如果链接失效,上方扫码回复即可)](https://www.geekxh.com/github_click.html?6072)
+
+#### 本项目还包括 I(支持下载):
+
+> 千本开源电子书覆盖了你在IT行业发展可以用到的大部分资料,百张思维导图按照专题对各类计算机知识进行了整合。**由于文件过大,建议通过下方扫码,回复【999】获取**
+
+- 📚 [一千本开源电子书](https://github.com/geekxh/hello-algorithm/tree/master/%E6%B8%85%E6%99%B0%E7%89%88%E7%94%B5%E5%AD%90%E4%B9%A61000%E6%9C%AC)
+- 🐒 [百张思维导图集锦](https://github.com/geekxh/hello-algorithm/tree/master/%E8%B6%85%E6%B8%85%E6%80%9D%E7%BB%B4%E5%AF%BC%E5%9B%BE100%E5%BC%A0)
+
+#### 本项目还包括 II(支持下载):
+
+> 大厂面经汇总覆盖了阿里、京东、华为、字节、滴滴、百度、美团、腾讯 等公司的面试题,按照 公司/专题 两个维度对面试题进行了整合。**由于文件过大,建议通过下方扫码,回复【面经】获取。**
+
+
+
+ 这也许是东半球最好的算法学习类项目! +
+ + +> 我自己刷题都是在 lintcode 进行,也会在上面更新题解!下方可以直接进入~ +- [www.lintcode.com](https://www.lintcode.com/?utm_source=tf-github-xh2022) +- [另外推荐一套算法课,北大FB双料大佬的,我之前上过,性价比很高](https://www.jiuzhang.com/course/71/?utm_source=tf-github-xh2022) +- 最后,下方扫码可以领取我准备的刷题模板 +
+
+
+ * Note that this object implements both interfaces to Originator and CareTaker + */ +public class PreviousCalculationImp implements PreviousCalculationToCareTaker, + PreviousCalculationToOriginator { + + private int firstNumber; + private int secondNumber; + + public PreviousCalculationImp(int firstNumber, int secondNumber) { + this.firstNumber = firstNumber; + this.secondNumber = secondNumber; + } + + @Override + public int getFirstNumber() { + return firstNumber; + } + + @Override + public int getSecondNumber() { + return secondNumber; + } +} +``` + +```java +/** + * CareTaker object + */ +public class Client { + + public static void main(String[] args) { + // program starts + Calculator calculator = new CalculatorImp(); + + // assume user enters two numbers + calculator.setFirstNumber(10); + calculator.setSecondNumber(100); + + // find result + System.out.println(calculator.getCalculationResult()); + + // Store result of this calculation in case of error + PreviousCalculationToCareTaker memento = calculator.backupLastCalculation(); + + // user enters a number + calculator.setFirstNumber(17); + + // user enters a wrong second number and calculates result + calculator.setSecondNumber(-290); + + // calculate result + System.out.println(calculator.getCalculationResult()); + + // user hits CTRL + Z to undo last operation and see last result + calculator.restorePreviousCalculation(memento); + + // result restored + System.out.println(calculator.getCalculationResult()); + } +} +``` + +```html +110 +-273 +110 +``` + +### JDK + +- java.io.Serializable + +你可以通过下方扫码回复【进群】,加入我们的高端计算机学习群!以及下载超过 100 张高清思维导图! + +
+ + + + + diff --git "a/other/designpattern/\345\244\226\350\247\202\346\250\241\345\274\217.md" "b/other/designpattern/\345\244\226\350\247\202\346\250\241\345\274\217.md" new file mode 100644 index 00000000..6c16edd8 --- /dev/null +++ "b/other/designpattern/\345\244\226\350\247\202\346\250\241\345\274\217.md" @@ -0,0 +1,71 @@ +## 外观(Facade) + +### 介绍 + +外观模式(Facade Pattern)隐藏系统的复杂性,并向客户端提供了一个客户端可以访问系统的接口。这种类型的设计模式属于结构型模式,它向现有的系统添加一个接口,来隐藏系统的复杂性。 + +这种模式涉及到一个单一的类,该类提供了客户端请求的简化方法和对现有系统类方法的委托调用。 + +### Intent + +提供了一个统一的接口,用来访问子系统中的一群接口,从而让子系统更容易使用。 + +### Class Diagram + +
-
-
-
-
-
{{ item.desc }}
-- {{ $frontmatter.tagline || $description || 'Welcome to your vuePress-theme-reco site' }} -
-
-
{{ feature.details }}
-- {{ $frontmatter.tagline || $description || 'Welcome to your vuePress-theme-reco site' }} -
-
-
- ←
-
{{$site.description || $localeConfig.description}}
-${info}
`, - after: '{{ getMsg() }}-
+ * Note that this object implements both interfaces to Originator and CareTaker + */ +public class PreviousCalculationImp implements PreviousCalculationToCareTaker, + PreviousCalculationToOriginator { + + private int firstNumber; + private int secondNumber; + + public PreviousCalculationImp(int firstNumber, int secondNumber) { + this.firstNumber = firstNumber; + this.secondNumber = secondNumber; + } + + @Override + public int getFirstNumber() { + return firstNumber; + } + + @Override + public int getSecondNumber() { + return secondNumber; + } +} +``` + +```java +/** + * CareTaker object + */ +public class Client { + + public static void main(String[] args) { + // program starts + Calculator calculator = new CalculatorImp(); + + // assume user enters two numbers + calculator.setFirstNumber(10); + calculator.setSecondNumber(100); + + // find result + System.out.println(calculator.getCalculationResult()); + + // Store result of this calculation in case of error + PreviousCalculationToCareTaker memento = calculator.backupLastCalculation(); + + // user enters a number + calculator.setFirstNumber(17); + + // user enters a wrong second number and calculates result + calculator.setSecondNumber(-290); + + // calculate result + System.out.println(calculator.getCalculationResult()); + + // user hits CTRL + Z to undo last operation and see last result + calculator.restorePreviousCalculation(memento); + + // result restored + System.out.println(calculator.getCalculationResult()); + } +} +``` + +```html +110 +-273 +110 +``` + +### JDK + +- java.io.Serializable + +你可以通过下方扫码回复【进群】,加入我们的高端计算机学习群!以及下载超过 100 张高清思维导图! + +
+ + + + + diff --git "a/\347\256\227\346\263\225\350\257\273\347\211\251/\350\256\276\350\256\241\346\250\241\345\274\217/\345\244\226\350\247\202\346\250\241\345\274\217.md" "b/\347\256\227\346\263\225\350\257\273\347\211\251/\350\256\276\350\256\241\346\250\241\345\274\217/\345\244\226\350\247\202\346\250\241\345\274\217.md" new file mode 100644 index 00000000..6c16edd8 --- /dev/null +++ "b/\347\256\227\346\263\225\350\257\273\347\211\251/\350\256\276\350\256\241\346\250\241\345\274\217/\345\244\226\350\247\202\346\250\241\345\274\217.md" @@ -0,0 +1,71 @@ +## 外观(Facade) + +### 介绍 + +外观模式(Facade Pattern)隐藏系统的复杂性,并向客户端提供了一个客户端可以访问系统的接口。这种类型的设计模式属于结构型模式,它向现有的系统添加一个接口,来隐藏系统的复杂性。 + +这种模式涉及到一个单一的类,该类提供了客户端请求的简化方法和对现有系统类方法的委托调用。 + +### Intent + +提供了一个统一的接口,用来访问子系统中的一群接口,从而让子系统更容易使用。 + +### Class Diagram + +