自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

importsys的博客

刷题 java

  • 博客(57)
  • 收藏
  • 关注

原创 git 命令总结

git 命令总结基本命令git 分支管理git是一个分布式管理系统基本命令将目录变成git可管理的仓库git init添加文件到git仓库git add git commit -m "message" 查看添加结果git status查看修改内容git diff README.txt查看历史记录git log --pretty=oneline 回退到上一个版...

2019-08-05 10:18:40 238

原创 Leetcode 28. Implement strStr() 实现 strStr()

@[TOC](Leetcode 28. Implement strStr() 实现 strStr())28. Implement strStr()题目描述Implement strStr().Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of hayst...

2019-08-04 14:24:59 183

原创 Leetcode 28. Implement strStr() 实现 strStr()

@[TOC](Leetcode 28. Implement strStr() 实现 strStr())28. Implement strStr()题目描述Implement strStr().Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of hayst...

2019-08-04 14:24:21 188

原创 Leetcode 524. Longest Word in Dictionary through Deleting 通过删除字母匹配到字典里最长单词

Leetcode 524. Longest Word in Dictionary through Deleting 通过删除字母匹配到字典里最长单词524. Longest Word in Dictionary through Deleting题目描述示例:解答代码524. Longest Word in Dictionary through Deleting题目描述Given a stri...

2019-08-04 10:30:35 144

原创 Leetcode 784. Letter Case Permutation 字母大小写全排列

Leetcode 784. Letter Case Permutation 字母大小写全排列Leetcode 784. Letter Case Permutation 字母大小写全排列题目描述示例:解答代码Leetcode 784. Letter Case Permutation 字母大小写全排列题目描述Given a string S, we can transform every let...

2019-08-04 10:27:52 173

原创 如何用Java asm打印类的所有public方法名称

如何用Java asm打印类的所有public方法名称如何用Java asm打印类的所有public方法名称1. 读取class,创建ClassReader, ClassWriter2. ClassVisitor的visitMethod方法如何用Java asm打印类的所有public方法名称1. 读取class,创建ClassReader, ClassWriter使用 ByteSource...

2019-08-03 19:53:50 510

原创 Java的几种instrument方法

Java的两种instrument方法Java的两种instrument方法1. 通过proxy2. 通过InvocationHandlerJava的两种instrument方法1. 通过proxy假设我们想在Account类中的operation中加入某个安全检查机制check。public class Account { public void operation() { ...

2019-08-03 19:38:25 670

原创 Java 反射类型Type用法总结

Java 反射类型:Type各个方法1. 得到class的成员变量2. field的函数3.获取范型的Type和Class总代码结果:各个方法1. 得到class的成员变量首先得到object的class对象然后在class对象中用getDeclaredFields()方法来获得class的成员变量 FieldTest ft = new FieldTest(); ...

2019-08-03 17:30:55 2941

原创 Java 的一些知识手册

Java 知识1. getResource2. getResourceAsStream3. Java get Date4. Maven 解决Error:java: release version 5 not supported问题5. Maven添加系统包6. java get public method of a class7. JAVA 自定义classloader(findClass)1....

2019-08-03 16:44:22 156

原创 JAVA虚拟机相关知识点总结

A. JVM内存管理JVM主要把内存划分如下几个区域方法区堆区本地方法栈虚拟机栈程序计数器1. 方法区方法区存放要加载的类的信息,静态变量,final常量,field和方法信息。方法区也包含运行时常量池,用于存储编译器生成的字面常量,符号引用(用字符表示某个变量接口的位置)和翻译出来的直接引用(符号引用翻译出来的地址)。这块区域是持久代,垃圾回收很少。通过 --XX:P...

2019-08-02 16:01:03 343

原创 LeetCode 898. Bitwise ORs of Subarrays 子数组按位或操作

LeetCode 898. Bitwise ORs of Subarrays 子数组按位或操作898. Bitwise ORs of Subarrays题目描述示例:解答代码898. Bitwise ORs of Subarrays题目描述We have an array A of non-negative integers.For every (contiguous) subarray ...

2019-07-07 10:13:12 496

原创 Java的几个基础知识点

java集合Java 中的集合分为value,keyvalue两种存储值得有List和SetList是有序的,可以重复的Set是无序的,不可重复的,根据equals和hashcode判断,如果一个对象要存储在set中,必须重写equals和hashCode方法。Java listList分为ArrayList和LinkedList区别:ArrayList底层使用数组,Linked...

2019-06-30 19:51:46 127

原创 几个常用的查询employee工资的sql语句

几个常用的查询employee工资的sql语句return employee record with max salaryselect * from employeewhere salary = (select Max(salary) from employee)select highest salary in employee tableselect Max(salary)...

2019-06-30 19:46:16 2488

原创 Leetcode 692. Top K Frequent Words 前K个高频单词(最小堆)

Leetcode 692. Top K Frequent Words 前K个高频单词:最小堆692. Top K Frequent Words 前K个高频单词题目描述示例:解答代码692. Top K Frequent Words 前K个高频单词题目描述Given a non-empty list of words, return the k most frequent elements....

2019-06-18 17:41:22 429

原创 Leetcode 878. Nth Magical Number 第 N 个神奇数字(二分查找)

Leetcode 878. Nth Magical Number 第 N 个神奇数字878. Nth Magical Number 第 N 个神奇数字题目描述示例:解答代码878. Nth Magical Number 第 N 个神奇数字题目描述A positive integer is magical if it is divisible by either A or B.Return ...

2019-06-18 17:32:26 384

原创 Leetcode 202. Happy Number 快乐数

Leetcode 202. Happy Number 快乐数202. Happy Number 快乐数题目描述示例:解答1代码1解答2代码2202. Happy Number 快乐数题目描述ShareWrite an algorithm to determine if a number is “happy”.A happy number is a number defined by th...

2019-06-18 15:45:58 446

原创 LeetCode 698. Partition to K Equal Sum Subsets 划分为k个相等的子集(典型递归问题)

LeetCode 698. Partition to K Equal Sum Subsets 划分为k个相等的子集:典型递归问题698. Partition to K Equal Sum Subsets 划分为k个相等的子集题目描述示例:解答代码698. Partition to K Equal Sum Subsets 划分为k个相等的子集题目描述Given an array of inte...

2019-06-18 15:26:54 268

原创 LeetCode 435. Non-overlapping Intervals 无重叠区间(贪心问题,两种解法)

LeetCode 435. Non-overlapping Intervals 无重叠区间435. Non-overlapping Intervals 无重叠区间题目描述示例:解答1代码1解答1代码1435. Non-overlapping Intervals 无重叠区间题目描述Given a collection of intervals, find the minimum number ...

2019-06-14 17:31:43 403

原创 LeetCode 452. Minimum Number of Arrows to Burst Balloons 用最少数量的箭引爆气球(贪心问题)

LeetCode 452. Minimum Number of Arrows to Burst Balloons 用最少数量的箭引爆气球452. Minimum Number of Arrows to Burst Balloons 用最少数量的箭引爆气球Description:Example:解答代码452. Minimum Number of Arrows to Burst Balloons ...

2019-06-14 16:54:02 305

原创 Leetcode 96. Unique Binary Search Trees 不同的二叉搜索树: 两种思路

Leetcode 96. Unique Binary Search Trees 不同的二叉搜索树: 两种思路96. Unique Binary Search Trees 不同的二叉搜索树题目描述示例:解答代码96. Unique Binary Search Trees 不同的二叉搜索树题目描述Given n, how many structurally unique BST’s (binar...

2019-06-13 15:51:24 320

原创 Leetcode 855. Exam Room 考场就座:提供两种解法

Leetcode 855. Exam Room 考场就座: 提供两种解法855. Exam Room 考场就座(两种解法)题目描述示例:解答1代码1解答2代码2855. Exam Room 考场就座(两种解法)题目描述In an exam room, there are N seats in a single row, numbered 0, 1, 2, …, N-1.When a stu...

2019-06-13 15:35:44 565

原创 Leetcode 70. Climbing Stairs 爬楼梯

Leetcode 70. Climbing Stairs 爬楼梯70. Climbing Stairs 爬楼梯题目描述示例:解答代码70. Climbing Stairs 爬楼梯题目描述You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or...

2019-06-10 18:05:31 226

原创 Leetcode 72. Edit Distance 编辑距离

Leetcode 72. Edit Distance 编辑距离72. Edit Distance 编辑距离题目描述示例:解答代码72. Edit Distance 编辑距离题目描述Given two words word1 and word2, find the minimum number of operations required to convert word1 to word2....

2019-06-10 18:00:01 391

原创 Leetcode 518. Coin Change 2 零钱兑换2

Leetcode 518. Coin Change 2 零钱兑换2322. Coin Change题目描述示例:解答代码322. Coin Change题目描述You are given coins of different denominations and a total amount of money. Write a function to compute the number of...

2019-06-09 21:06:28 243

原创 Leetcode 322. Coin Change 零钱兑换

Leetcode 322. Coin Change 零钱兑换322. Coin Change题目描述示例:解答代码322. Coin Change题目描述You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewes...

2019-06-09 21:00:42 192

原创 Java实现并发的几种方法

Java实现并发的几种方法Java实现并发的几种方法synchronizedVolatileThreads 和 RunnableThread poolsCompletableFuture)Java实现并发的几种方法Java程序默认以单线程方式运行。synchronizedJava 用过synchronized 关键字来保证一次只有一个线程在执行代码块。public synchroni...

2019-06-08 20:37:51 6963

原创 Java单例设计模式介绍

单例设计模式单例设计模式饿汉式:1. 直接实例化2. 枚举3. 静态代码块懒汉式:在方法里面创建对象在内部类被加载和初始化时创建对象单例设计模式Ensure a class has only one instance, and provide a global point of access to it. ---Wikipedia单例设计模式是指某个类在整个系统中只能有一个实例对象可以被获...

2019-06-08 20:36:29 107

原创 用python读写HDF5格式文件

用python读写HDF5格式文件用python读写HDF5格式文件HDF5介绍创建HDF5文件读取HDF5文件HDF5的group用python读写HDF5格式文件HDF5介绍       HDF(Hierarchical Data File)是美国国家高级计算应用中心(National Center for Supercomputing Appli...

2019-06-07 11:58:41 12470

原创 用Python来实现Base64编码和解码

用Python来实现Base64编码和解码用Python来实现Base64编码和解码Base64编码Python代码实现Base64解码总代吗用Python来实现Base64编码和解码Base64是一种常见的编码和解码方式,Base64用7 bits的可打印字符来表示8-bit的二进制数据。base64在HTTP和XML上用的特别多,许多HTTP传输和email中都用到了Base64进行编码和...

2019-06-07 11:23:41 2137

原创 CMU Advanced DB 课程笔记#2:数据库工作负载和数据库事务模型

CMU Advanced DB 课程笔记#2:数据库工作负载和数据库事务模型CMU Advanced DB 课程笔记#2:数据库工作负载和数据库事务模型数据库工作负载:数据库事务(Transaction简称为Txn):Transaction Model:Flat Txns:Flat Txns+ Savepoints:Nested TxnsChained Txns:Compensating Txns...

2019-06-06 20:23:36 2128 2

原创 LeetCode 198. House Robber 打家劫舍

LeetCode 198. House Robber 打家劫舍198. House Robber题目描述示例:解答代码198. House Robber题目描述You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed...

2019-06-06 00:15:23 189

原创 LeetCode 112. Path Sum 路径总和

Leetcode 112. Path Sum 路径总和112. Path Sum 路径总和题目描述示例:解答1代码1解答2代码2112. Path Sum 路径总和题目描述Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values...

2019-06-05 21:45:50 146

原创 LeetCode 303. Range Sum Query - Immutable 区域和检索 - 数组不可变

LeetCode 303. Range Sum Query - Immutable 区域和检索 - 数组不可变303. Range Sum Query - Immutable题目描述示例:解答代码303. Range Sum Query - Immutable题目描述Given an integer array nums, find the sum of the elements betwe...

2019-06-04 21:48:22 171

原创 LeetCode 139. Word Break 单词拆分

Leetcode 139. Word Break 单词拆分139. Word Break 单词拆分题目描述示例:解答1代码1解答2代码2139. Word Break 单词拆分题目描述Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s...

2019-06-04 20:24:39 221

原创 LeetCode 726. Number of Atoms 原子的数量

LeetCode 726. Number of Atoms 原子的数量726. Number of Atoms 原子的数量题目描述示例:解答代码726. Number of Atoms 原子的数量题目描述Given a chemical formula (given as a string), return the count of each atom.An atomic element ...

2019-06-03 21:23:22 199

原创 CMU Advanced DB 课程笔记#1:传统DBMS读取操作原理和内存模型以及In-memory DBMS的改进

CMU Advanced DB 课程笔记#1:Disk-oriented DBMS和In-memory DBMS对比Disk-oriented DBMS和In-memory DBMS对比Disk-oriented DBMS介绍读数据操作日志和恢复机制:STEAL + NO-FORCE policy.In-memory DBMS介绍数据组织形式索引查询日志和恢复Disk-oriented DBMS...

2019-06-03 17:56:25 804

原创 Leetcode 82. Remove Duplicates from Sorted List II 删除排序链表中的重复元素 II

Leetcode 82. Remove Duplicates from Sorted List II 删除排序链表中的重复元素 II1. Two Sum题目描述示例:解答1代码1解答2代码21. Two Sum题目描述Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only d...

2019-06-02 20:15:38 297

原创 Leetcode 83. Remove Duplicates from Sorted List 删除排序链表中的重复元素

Leetcode 83. Remove Duplicates from Sorted List 删除排序链表中的重复元素1. Two Sum题目描述示例:解答1代码1解答2代码21. Two Sum题目描述Given a sorted linked list, delete all duplicates such that each element appear only once.示例:...

2019-06-02 20:13:32 249

原创 如何用Netty进行socket编程

如何用Netty进行socket编程如何用Netty进行socket编程工程结构Server部分编写Server主程序Server初始化Server请求处理Client部分编写Client主程序Client初始化Client消息处理如何用Netty进行socket编程前一篇文章讲的是如何用Netty进行http服务器的编写,http是应用层协议,Netty不仅可以直接操作应用层,还可以接触最底...

2019-06-01 08:39:04 1049

原创 Leetcode 1011. Capacity To Ship Packages Within D Days 在 D 天内送达包裹的能力

Leetcode 1011. Capacity To Ship Packages Within D Days 在 D 天内送达包裹的能力1011. Capacity To Ship Packages Within D Days题目描述:示例:解答:代码:1011. Capacity To Ship Packages Within D Days题目描述:A conveyor belt has ...

2019-05-31 23:33:24 230

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除