原创 LeetCode79 Word Search
Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of seque
原创 淺談RFC調用
淺談RFC調用
原创 深入剖析Java中的裝箱和拆箱(緩存池技術)
1. 什麼是裝箱?什麼是拆箱? **簡單一點說,裝箱就是 自動將基本數據類型轉換爲包裝器類型;拆箱就是 自動將包裝器類型轉換爲基本數據類型。** 2. 裝箱和拆箱是如何實現的 a:反編譯class文件:javap -c 類名
原创 LeetCode62 Unique Paths
動態規劃 dp[i][j] = dp[i-1][j]+dp[i][j-1] class Solution { public int uniquePaths(int m, int n) { if(m ==
原创 劍指offer 數組中出現次數超過一半的數字
**題目描述** 數組中有一個數字出現的次數超過數組長度的一半,請找出這個數字。 例如輸入一個長度爲9的數組{1,2,3,2,2,2,5,4,2}。 由於數字2在數組中出現了5次,超過數組長度的一半,因此輸出2。如果不存在則輸出0
原创 二叉樹中的路徑和
** 劍指offer 二叉樹中和爲某一值的路徑 ** 題目描述 輸入一顆二叉樹的跟節點和一個整數,打印出二叉樹中結點值的和爲輸入整數的所有路徑。路徑定義爲從樹的根結點開始往下一直到葉結點所經過的結點形成一條路徑。(注意: 在返回
原创 劍指offer 二叉搜索樹與雙向鏈表
輸入一棵二叉搜索樹,將該二叉搜索樹轉換成一個排序的雙向鏈表。要求不能創建任何新的結點,只能調整樹中結點指針的指向。 這道題仔細看,就會發現是中序遍歷+改變指針指向。 但我就是那麼菜,明明知道了總體思路還是不會編,最後看了討論區
原创 Leetcode 300
原文鏈接:https://leetcode.com/problems/longest-increasing-subsequence/ 關於 Arrays.binarySearch()
原创 母牛生小牛
原文鏈接:https://sgeekioi.github.io/2019/07/17/NumOfCow/ 母牛生小牛 題目 假設農場中成熟的母牛每年只會生1頭小母牛,並且永遠不會死。第一
原创 MySQL索引(二)B+樹在磁盤中的存儲
MySQL索引(二)B+樹在磁盤中的存儲
原创 324. Wiggle Sort II
Given an unsorted array nums, reorder it such that nums[0] < nums[1] > nums[2] < nums[3]… Example 1: Input: nums = [
原创 Java中Comparable和Comparator區別總結
一、Comparable簡介 Comparable是排序接口。若一個類實現了Comparable接口,就意味着該類支持排序。實現了Comparable接口的類的對象的列表或數組可以通過Collections.sort或Arrays.s
原创 290. Word Pattern
Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that the
原创 148. Sort List
Sort a linked list in O(n log n) time using constant space complexity. 這道題是Linked List的排序,但是對空間複雜度是有要求的。 我首先把昨天學會的那個插
原创 147. Insertion Sort List
Sort a linked list using insertion sort. Algorithm of Insertion Sort: 1、Insertion sort iterates, consuming one input