自定义博客皮肤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

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

原创 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 160

原创 几个常用的查询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 2584

原创 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 575

原创 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 524

原创 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 605

原创 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 283

原创 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 432

原创 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 411

原创 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 335

原创 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 684

原创 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 353

原创 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 405

原创 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 261

原创 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 203

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

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

2019-06-08 20:37:51 7253

原创 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 284

原创 用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 12550

原创 用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 2280

原创 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 2368 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 223

原创 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 185

原创 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 224

原创 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 263

原创 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 270

原创 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 969

原创 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 476

原创 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 370

原创 如何用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 1244

空空如也

空空如也

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

TA关注的人

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