排序思路 头函数 algorithm 中有一个函数是 upper_bound(start,end,value) 它可以返回区间 [start,end] 中第一个大于等于 value 的值的位置 再加上 vector 中自带的插入函数 insert(space,value) 就可以对数据进行类似于二分 ...
分类:
编程语言 时间:
2021-04-23 12:12:05
阅读次数:
0
1. 用union结构区分大小端 #define read_bits(stc, field)({stc.raw = 0x12345678; stc.bits.field;}) union a{ unsigned int raw; struct { unsigned int bit_a : 8; un ...
分类:
其他好文 时间:
2021-04-23 12:09:11
阅读次数:
0
/* * @lc app=leetcode.cn id=1143 lang=cpp * * [1143] 最长公共子序列 * * https://leetcode-cn.com/problems/longest-common-subsequence/description/ * * algorith ...
分类:
其他好文 时间:
2021-04-23 12:08:02
阅读次数:
0
一、递归函数 看如下递归函数: 1 int f(int n){ 2 if(n == 1){ 3 return 1; 4 } 5 return f(n - 1) + 1; 6 } 客户端调用该递归函数时传入n = 5, 返回的函数值为5。那么它的调用堆栈(call stack)是怎么样的?又是如何计算 ...
分类:
其他好文 时间:
2021-04-23 12:01:13
阅读次数:
0
首发于Enaium的个人博客 不用XML只用注解 首先需要创建6个注解 SQL用于输入SQL语句 @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) public @interface SQL { String[] valu ...
分类:
其他好文 时间:
2021-04-22 16:14:47
阅读次数:
0
初识finally finally子句中的代码是最后执行的,并且是一定会执行的,即使try语句块中的代码出现了异常。 finally子句必须和try一起出现,不能单独使用。执行顺序:try→finally→return。 finally应用场景。 通常在finally语句块中完成资源的释放/关闭。 ...
分类:
其他好文 时间:
2021-04-22 16:08:18
阅读次数:
0
this.Dsct = function (x1, y1, x2, y2) { var r, dx, dy; dx = x1 - x2; dy = y1 - y2; r = Math.sqrt(dx * dx + dy * dy); return r; } /* 直线到原点距离 d=abs(c)/s ...
分类:
其他好文 时间:
2021-04-22 16:01:39
阅读次数:
0
<?php //index.php 公众号后台配置的路径是这个index.php $wechatObj = new wechat(); $wechatObj->responseMsg(); class wechat { //返回消息模板 private $textTpl = [ 'text' => ...
分类:
微信 时间:
2021-04-22 15:53:55
阅读次数:
0
Given an m x n matrix, return all elements of the matrix in spiral order. Example 1: Input: matrix = [[1,2,3],[4,5,6],[7,8,9]] Output: [1,2,3,6,9,8,7, ...
分类:
其他好文 时间:
2021-04-22 15:34:12
阅读次数:
0
1.在控制台输入js代码: (function (console) { console.save = function (data, filename) { let MIME_TYPE = "text/json"; if (!data) return; if (!filename) filename ...
分类:
其他好文 时间:
2021-04-22 15:33:13
阅读次数:
0