ARTS (第38周)
Algorithm 算法
二维数组中的查找
在一个二维数组中(每个一维数组的长度相同),每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。
思路1:
想着先按行进行二分查找,然后再按列进行二分查找,
结果发现是错误的。因为从行的关系里无法确定出列的关系。
1 | public boolean Find(int target, int[][] array) { |
思路2:按行进行二分
1 | // 题目描述 |
Review 英文文章
https://vuejs.org/v2/guide/index.html
vue的简易使用入门
Tip 技巧
1、java 的<<、 >> 、>>>位运算的掩码
If the promoted type of the left-hand operand is int, then only the five lowest-order bits of the right-hand operand are used as the shift distance. It is as if the right-hand operand were subjected to a bitwise logical AND operator & (§15.22.1) with the mask value 0x1f (0b11111). The shift distance actually used is therefore always in the range 0 to 31, inclusive.
如果左侧操作数的提升类型为int,则仅使用右侧操作数的五个最低阶位作为移位距离。就好像右边的操作数受到了一个位逻辑与运算符&(§15.22.1),掩码值为0x1f(0b11111)。因此,实际使用的移位距离始终在0到31之间(包括0到31)。
2、IEEE754标准
这是是一种浮点数表示标准
一般分为单、双精度两种
单精度是32位的二进制数,双精度是64位的二进制数
一个浮点数的组成分为三个部分
第1位是数符s s=1表示负数 s=0表示正数
第2-9位为阶码E (双精度为2-12位)
第10-32位为尾数M (双精度为13-64位)
转换大致过程如下:
将十进制数转为二进制数 用类似于科学计数法的形式表示成
V=(-1)^s(1+M)2^(E-127)(单精度)
V=(-1)^s(1+M)2^(E-1023)(双精度)
然后将每部分算出的数值按顺序排列
例如:
-0.0625=-1.0*2^(-4)
s=1,M=1-1=0,E=-4 +127=123=0111 1011 ,E(双精度)=-4 +1023=1019 =0111 1111 011
单精度:1011 1101 1000 0000 0000 0000 0000 0000
双精度:1011 1111 1011 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
https://zhidao.baidu.com/question/188228095.html用户 leeesoooleon
Share 分享
https://blog.csdn.net/u013094181/article/details/21863491 负数取余运算
https://blog.csdn.net/m0_37482190/article/details/86544398 64位 32位的系统区别