package main import "fmt" func main() { var numbers []int printSlice(numbers) /* 允许向空切片追加元素 */ numbers = append(numbers, 0) printSlice(numbers) /* 向切片 ...
分类:
移动开发 时间:
2020-06-09 09:21:48
阅读次数:
69
public class Palindrome_Number9 { public static boolean isPalindrome(int x) { if(x<0){ return false; } String result=new Integer(x).toString(); for(in ...
分类:
其他好文 时间:
2020-06-07 15:11:13
阅读次数:
54
复习了原码、反码、补码,位运算(尤其是异或,Java记作【^】) a^b=b^a a^0=a a^a=0 a^b=c > a^b^b=c^b > a=c^b 注意:位运算时,符号位也是参与运算的。 给定一个整数数组 nums,其中恰好有两个元素只出现一次,其余所有元素均出现两次。 找出只出现一次的那 ...
分类:
其他好文 时间:
2020-06-06 21:56:13
阅读次数:
77
TCP握手协议 在TCP/IP协议中,TCP协议提供可靠的连接服务,采用三次握手建立一个连接.第一次握手:建立连接时,客户端发送syn包(syn=j)到服务器,并进入SYN_SEND状态,等待服务器确认; SYN:同步序列编号(Synchronize Sequence Numbers)第二次握手:服 ...
分类:
其他好文 时间:
2020-06-06 11:17:49
阅读次数:
50
问题:Given two integers n and k, return all possible combinations of k numbers out of 1 … n. For example,If n = 4 and k = 2, a solution is: [ [2,4], [3, ...
分类:
其他好文 时间:
2020-06-06 01:16:22
阅读次数:
93
1066 Root of AVL Tree (25分) An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node diff ...
分类:
其他好文 时间:
2020-06-05 23:18:28
阅读次数:
73
Block element Block elements, or block-level elements, have a rectangular structure. By default, these elements will span the entire width of its pare ...
分类:
Web程序 时间:
2020-06-05 21:12:41
阅读次数:
89
package LeetCode_1365 import java.util.* /** * 1365. How Many Numbers Are Smaller Than the Current Number * https://leetcode.com/problems/how-many-num ...
分类:
其他好文 时间:
2020-06-04 19:56:56
阅读次数:
67
31把数组排成最小的数 输入一个正整数数组,把数组里所有数字拼接起来排成一个数,打印能拼接出的所有数字中最小的一个。例如输入数组{3,32,321},则打印出这三个数字能排成的最小数字为321323。 比较两个字符串s1, s2大小的时候,先将它们拼接起来,比较s1+s2,和s2+s1那个大,如果s ...
分类:
其他好文 时间:
2020-06-02 18:58:11
阅读次数:
61
Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. Example: Input: n = 4, k = 2 Output: [ [2,4], [3,4], [2,3], ...
分类:
其他好文 时间:
2020-05-31 13:17:49
阅读次数:
57