给定两个字符串 s 和 t,它们只包含小写字母。字符串 t 由字符串 s 随机重排,然后在随机位置添加一个字母。请找出在 t 中被添加的字母。 示例: 输入: s = "abcd" t = "abcde" 输出: e 解释: 'e' 是那个被添加的字母。解法:JAVA思想:1.先对两字符串进行排序; ...
分类:
其他好文 时间:
2019-01-22 21:54:54
阅读次数:
379
import java.util.Arrays; public class Kong { public static void main(String[] args) { int[] arr = { 'a', 'c', 93, 92, 97, 'b' }; int[] arr2 = { 'a', ' ...
分类:
编程语言 时间:
2019-01-22 17:32:21
阅读次数:
186
There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity sh ...
分类:
其他好文 时间:
2019-01-22 12:22:34
阅读次数:
165
概念 Java中数组属于引用类型。数组使用场合较多,对于数组的操作具有一定重复性,例如:数组拷贝,转换字符串,转换成数组,排序等等。既然重复的操作与需求多,那么对于数组操作的支持就成了JDK中的一大需求。java.util.Arrays中提供了很多对数组操作的支持。 System.arraycopy ...
分类:
编程语言 时间:
2019-01-20 20:56:10
阅读次数:
216
[toc] 题目链接 "Median of Two Sorted Arrays LeetCode" 注意点 要考虑数组长度不一致的情况 解法 解法一:将两个数组合并成一个有序数组,根据数组长度分奇偶情况求中位数。时间复杂度为O(m+n) class Solution { public: double ...
分类:
其他好文 时间:
2019-01-20 15:09:39
阅读次数:
181
package com.zlhj.logic.doc;import java.util.Arrays;/** * 类的作用: * * @ClassName : Tser * @Author : liyang * @Date : 2019/1/19 17:00 * @Version 1.0 *//* ...
分类:
编程语言 时间:
2019-01-19 20:11:20
阅读次数:
203
package 快速排序; import java.util.Arrays; public class 快速排序 { public static void main(String[] args) { int[] a = {1, 2, 4, 5, 7, 4, 5 ,3 ,9 ,0}; System.o... ...
分类:
编程语言 时间:
2019-01-19 20:04:01
阅读次数:
167
There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity sh ...
分类:
其他好文 时间:
2019-01-19 13:14:15
阅读次数:
137
什么是Redis "1.简介" "2.安装" Redis基本数据类型 "1.Binary safe stings" "2.Lists" "3.Sets" "4.Hashes" "5.Bit arrays" "6.HyperLogLogs" Redis编程 "1.redis可作为消息发布、订阅系统" ...
分类:
其他好文 时间:
2019-01-19 12:20:02
阅读次数:
209
整体类图 Java集合是java提供的工具包,包含了常用的数据结构:集合、链表、队列、栈、数组、映射等。Java集合工具包位置是java.util.*Java集合主要可以划分为4个部分:List列表、Set集合、Map映射、工具类(Iterator迭代器、Enumeration枚举类、Arrays和 ...
分类:
编程语言 时间:
2019-01-18 00:51:06
阅读次数:
190