#include <stdio.h> typedef struct Node { int data; struct Node* lchild; struct Node* rchild; }Node; typedef Node* BinTree; int array[] = {1,2,3,4,5,6, ...
分类:
编程语言 时间:
2020-11-27 10:52:16
阅读次数:
17
策略模式是JavaScript设计模式中行为型的设计模式; 定义: 定义一系列算法,并将这些算法各自封装成策略类(方法),然后将不变的部分和变化的部分分离开来,并且这些算法可以相互替换 白话解释: 实际上所谓的策略模式就是值根据不同的策略来执行不同的方法,是不是很类似与if-else分支判断;但是策 ...
分类:
Web程序 时间:
2020-11-26 15:21:44
阅读次数:
12
分析:软键盘弹出后,导致页面高度变化 解决方案:软键盘弹出后,修复页面高度 // 监听窗口变化 resizeScreen(){ if (!this.state.isIOS && this.state.isInApp) { var originHeight = document.documentEle ...
分类:
移动开发 时间:
2020-11-26 15:15:42
阅读次数:
27
serialize() <form id="dialog_form1" action="" method="post"> </form> var form = $("#dialog_form1"); $.ajax({ url:form.attr('action'), type:form.attr(' ...
分类:
Web程序 时间:
2020-11-26 15:02:14
阅读次数:
11
KMP https://www.zhihu.com/question/21923021 的总结 实现 string : 主体字符串 (用 i 遍历) sptr : 匹配字符串 (用 j 遍历) string[i] != sptr[j] 时,如果 sptr 前 j-1 部分存在前缀与后缀相同的部分,只 ...
分类:
其他好文 时间:
2020-11-26 14:31:26
阅读次数:
4
操作系统-操作系统-内核中的屏幕打印(下)接着之前的实现顺序来,对PrintString进行实现intPrintString(constchar*s)//需f要对参数进行判断,如果参数为空,返回-1{intret=0;if(s!=NULL){while(*s){ret+=PrintChar(*s++);//不为空时进行循环,直到遇见结束符结束}}else{ret=-1;}returnret;}//
分类:
其他好文 时间:
2020-11-26 14:25:31
阅读次数:
5
react hooks是 react 16.8 引入的特性,这里我们通过对react-hook-form进行分析来了解成熟的库是如何使用hook的。这将是一个系列,首先推荐 useRef 简介 在react中,我们使用Ref来获取组件的实例或者DOM元素。我们可以使用两种方式来创建 Ref impo ...
分类:
其他好文 时间:
2020-11-26 14:15:05
阅读次数:
4
11.11 41. 132模式 给定一个整数序列:a1, a2, ..., an,一个132模式的子序列 ai, aj, ak 被定义为:当 i < j < k 时,ai < ak < aj。设计一个算法,当给定有 n 个数字的序列时,验证这个序列中是否含有132模式的子序列。 输入: [-1, 3 ...
分类:
其他好文 时间:
2020-11-25 12:23:43
阅读次数:
6
实现 strStr() 函数。 给定一个 haystack 字符串和一个 needle 字符串,在 haystack 字符串中找出 needle 字符串出现的第一个位置 (从0开始)。如果不存在,则返回 -1。 示例 1: 输入: haystack = "hello", needle = "ll" ...
分类:
其他好文 时间:
2020-11-25 12:19:34
阅读次数:
5
C++ 内联函数 #include <iostream> using namespace std; inline int Max(int a, int b) { if (a > b) return a; else return b; } int main() { cout << Max(23, 5) ...
分类:
其他好文 时间:
2020-11-25 12:08:44
阅读次数:
2