方法的参数传递机制 1、形参是基本数据类型 * 传递数据值 2、实参是引用数据类型 * 传递地址值 * 特殊的类型:String、包装类等对象不可变形 1 package com.test.code; 2 3 import java.util.Arrays; 4 5 /** 6 * 方法的参数传递机 ...
分类:
编程语言 时间:
2020-06-05 00:26:38
阅读次数:
88
题目描述: 给你两个有序整数数组 nums1 和 nums2,请你将 nums2 合并到 nums1 中,使 nums1 成为一个有序数组。 思路一:直接利用python中的sorted()函数 class Solution: def merge(self, nums1: List[int], m: ...
分类:
编程语言 时间:
2020-06-04 21:44:49
阅读次数:
77
多个 ssh key 配置多个网站 一、生成ssh key ssh-keygen -t rsa -C "你的邮箱" -f ~/.ssh/id_rsa_one ssh-keygen -t rsa -C "你的邮箱" -f ~/.ssh/id_rsa_two # 不添加-f 参数 会默认将私钥保存在~/ ...
分类:
其他好文 时间:
2020-06-04 20:05:42
阅读次数:
65
查找file1中每一行是否在file2中,若在输出到InRight.txt, 若不在输出到NotInRight.txt. f1=$1f2=$2 while read mylinedo grepR=`grep $myline $f2` if [[ $grepR != "" ]]; then echo ...
分类:
系统相关 时间:
2020-06-04 14:01:58
阅读次数:
63
大家可能都知道很熟悉Spark的两种常见的数据读取方式(存放到RDD中):(1)、调用parallelize函数直接从集合中获取数据,并存入RDD中;Java版本如下: JavaRDD<Integer> myRDD = sc.parallelize(Arrays.asList(1,2,3)); Sc ...
分类:
其他好文 时间:
2020-06-04 10:38:09
阅读次数:
76
package com.steven.array; public class ArrayDemo2 { public static void main(String[] args) { int[] arrays = {1, 2, 3, 4, 5}; // 打印数组中所有的元素 for (int i ...
分类:
编程语言 时间:
2020-06-04 01:34:38
阅读次数:
62
题目如下: Given two strings: s1 and s2 with the same size, check if some permutation of string s1 can break some permutation of string s2 or vice-versa (i ...
分类:
其他好文 时间:
2020-06-03 23:41:15
阅读次数:
108
There are 2N people a company is planning to interview. The cost of flying the i-th person to city A is costs[i][0], and the cost of flying the i-th p ...
分类:
其他好文 时间:
2020-06-03 23:34:27
阅读次数:
72
题目如下: You are given an integer num. You will apply the following steps exactly two times: Pick a digit x (0 <= x <= 9). Pick another digit y (0 <= y < ...
分类:
其他好文 时间:
2020-06-03 23:33:43
阅读次数:
70
这是一个可以为null的容器对象。如果值存在则isPresent()方法会返回true,调用get()方法会返回该对象。 package com.polaris; import java.util.Arrays; import java.util.List; import java.util.Opt ...
分类:
编程语言 时间:
2020-06-03 15:12:52
阅读次数:
51