原创 【Database】【LeetCode】175. Combine Two Tables

SQL Schema > Create table Person (PersonId int, FirstName varchar(255), LastName varchar(255)) Create table Address (A

原创 請談談你對OOM的認識

  java.lang.StackOverflowError public class StackOverflowErrorDemo { public static void main(String[] args) {

原创 【Java】【LeetCode】200. Number of Islands

Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and

原创 【消息中間件之ActiveMQ】高級特性之消費重試機制

具體哪些情況會引起消息重發 1. Client用了transactions且在session中調用了rollback() 2. Client用了transactions且在調用commit()之前關閉或者沒有commit 3. Clien

原创 【Java】【LeetCode】64. Minimum Path Sum

題目: Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the

原创 最長連續降序數字子串

import java.util.ArrayList; import java.util.List; public class LongestConsecutiveDescendingNumberSubstring { pu

原创 Java:同步容器與併發容器有什麼區別?

何爲同步容器:可以簡單地理解爲通過synchronized來實現同步的容器,如果有多個線程調用同步容器的方法,它們將會串行執行。比如Vector,Hashtable,以及Collections.synchronizedSet,synchr

原创 【Database】【LeetCode】182. Duplicate Emails

SQL Schema > Create table If Not Exists Person (Id int, Email varchar(255)); Truncate table Person; insert into Person

原创 螞蟻美團面試題

原创 ArrayList和LinekdList的插入和訪問的時間複雜度

總結: 1.ArrayList是線性表(動態數組),LinkedList是鏈表 2.get,set方法,方法參數有指定位置數值的,ArrayList要優於LinkedList,因爲,ArrayList有下標,LinkedList要移動指針

原创 【Database】【LeetCode】180. Consecutive Numbers

SQL Schema > Create table If Not Exists Logs (Id int, Num int); Truncate table Logs; insert into Logs (Id, Num) values

原创 【Database】【LeetCode】178. Rank Scores

SQL Schema > Create table If Not Exists Scores (Id int, Score DECIMAL(3,2)) Truncate table Scores insert into Scores (

原创 【Database】【LeetCode】176. Second Highest Salary

SQL Schema > Create table If Not Exists Employee (Id int, Salary int) Truncate table Employee insert into Employee (Id

原创 sleep(long n) 和 wait(long n) 的區別

1) sleep 是 Thread 方法,而 wait 是 Object 的方法 2) sleep 不需要強制和 synchronized 配合使用,但 wait 需要和 synchronized 一起用 3) sleep 在睡眠的同時,