将两个升序链表合并为一个新的 升序 链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。 示例: 输入:1->2->4, 1->3->4 输出:1->1->2->3->4->4 使用了递归的方法,从两个链表的头部依次比较链表节点中值的大小,把值更小的节点返回到新链表的头部 /** * Def ...
分类:
其他好文 时间:
2020-07-15 15:10:04
阅读次数:
58
首先新建一个Xss处理的帮助类 public static class XSSHelper { /// <summary> /// XSS过滤 /// </summary> /// <param name="html">html代码</param> /// <returns>过滤结果</return ...
分类:
Web程序 时间:
2020-07-15 01:28:29
阅读次数:
98
只需要把两个串拼接起来,之后求一下后缀数组求可覆盖最长重复子串模板即可 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<string> using namespace std; ty ...
分类:
编程语言 时间:
2020-07-15 01:12:09
阅读次数:
72
思路: 1.创建两个空链表 2.遍历原始链表 3.将大于x的node中的val放入到maxlist,将小于node的放入到minlist中 4.将两个链表拼接在一起 /** * Definition for singly-linked list. * struct ListNode { * int ...
分类:
其他好文 时间:
2020-07-14 21:45:26
阅读次数:
53
汉诺塔问题 golang 递归 实现经典汉诺塔问题 汉诺塔动画演示 // 从A-->C ,借助B func hanota(A []int, B []int, C []int) []int { n := len(A) helpHanota(n, &A, &B, &C) return C } func ...
分类:
其他好文 时间:
2020-07-14 16:34:30
阅读次数:
56
前台通过JS代码判断图片格式 var uploadpath = document.getElementById('uploadpath'); var simplepath = uploadpath.innerText; var pathsuffix = simplepath.substr(simpl ...
分类:
其他好文 时间:
2020-07-13 18:07:58
阅读次数:
64
(贪心、字符串) ##题目大意 给一些字符串,求它们拼接起来构成最小数字的方式 ##思路 贪心算法。用cmp排序,直接判断a+b和b+a的大小即可。 必须保证两个字符串构成的数字是最小的才行,所以cmp函数写成return a + b < b + a;的形式,保证它排列按照能够组成的最小数字的形式排 ...
分类:
其他好文 时间:
2020-07-13 14:04:47
阅读次数:
60
string str;//文件路径int pos=str.find_last_of("/"); str=str.substr(0,pos); vector<string > filenames;while(_access(str.c_str(),0) 1){ pos=str.find_last_of ...
分类:
编程语言 时间:
2020-07-13 13:54:40
阅读次数:
94
###获取对象属性 get_object_vars 注意: get_class_vars 获取的属性的值是初始化的默认值,不是运行过程中,更改的值。 get the classname without the namespace function get_class_name($classname) ...
分类:
Web程序 时间:
2020-07-13 11:54:23
阅读次数:
67
1 一个结合文件发送,命令行,监控一体化的链接工具支持跨平台 http://www.hostbuf.com/?install_fs 按照顺序双击即可 2 命令行安装python(root身份),命令完全兼容centos7.6 https://www.linuxidc.com/Linux/2018-0 ...
分类:
编程语言 时间:
2020-07-13 11:16:12
阅读次数:
90