原创 Leetcode122 Best Time to Buy and Sell Stock II

原題目Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find t

原创 Leetcode398 Random Pick Index

題目Given an array of integers with possible duplicates, randomly output the index of a given target number. You can assu

原创 Java多線程:Volatile關鍵字

volatile關鍵在是在java 5後得到完善後,才被推廣使用的。 java內存模型中對volatile型變量的特殊規則 volatile關鍵字的使用方法:volatile關鍵字是java虛擬機提供的最輕量級的同步機制。 volat

原创 操作系統讀書筆記-chap1

參考書目爲:Operating System Concepts(9th Edition) 第一章  操作系統概述 1.1 什麼是操作系統 操作系統可以看作用戶和硬件之間的中間人,爲用戶方便有效地執行程序提供環境。 操作系統本質就是能夠管理

原创 java動態綁定和靜態綁定用法實例詳解

這篇文章主要介紹了java動態綁定和靜態綁定用法,結合實例形式詳細分析了java動態綁定與靜態綁定相關概念、原理、實現方法及使用注意事項,需要的朋友可以參考下 本文實例講述了java動態綁定和靜態綁定用法。分享給大

原创 java內部類原理與用法詳解

這篇文章主要介紹了java內部類原理與用法,結合實例形式分析了Java內部類的概念、原理、分類及相關使用技巧,需要的朋友可以參考下 本文實例講述了java內部類原理與用法。分享給大家供大家參考,具體如下: 概念 內

原创 java的繼承原理與實現方法詳解

這篇文章主要介紹了java的繼承原理與實現方法,結合實例形式詳細分析了Java繼承的概念、原理、用法及相關操作注意事項,需要的朋友可以參考下 本文實例講述了java的繼承原理與實現方法。分享給大家供大家參考,具體如

原创 Spring源碼---BeanFactory接口體系分析

參考資源 Spring源碼解析-BeanFactory接口體系解讀   BeanFactory接口體系源碼分析 下圖爲spring源碼中BeanFactory接口體系結構 spring的BeanFactory接口體系結構中,每個結構實現

原创 Leetcode 67

英文原題Given two binary strings, return their sum (also a binary string).The input strings are both non-empty and contains

原创 Leetcode 58 Length of Last Word

原題Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last wor

原创 java的動態綁定和靜態綁定

背景 1.當子類和父類存在同一個方法,子類重寫了父類的方法,程序在運行時調用的是父類的方法還是子類的重寫方法呢(尤其是存在向上類型轉換的情況)? 2.當一個類中存在方法名相同但參數不同(重載)的方法,程序在執行的時候該如何辨別區分使用哪個

原创 回溯算法原理總結

回溯算法理論總結 回溯法是一種類似枚舉的搜索嘗試過程,既然是枚舉,那麼就會遍歷解空間樹中的所有解(或者是“路徑”),搜索的過程按照DFS原則,而嘗試就意味着,在遍歷的過程中,有可能到達某一個結點後,發現不能夠滿足約束條件,在這次嘗試中,這

原创 java異常

java的異常機制 Throwable類 Throwable類是Java異常類型的頂層父類,一個對象只有是 Throwable 類的(直接或者間接)實例,他纔是一個異常對象,才能被異常處理機制識別。JDK中內建了一些常用的異常類,我們也可

原创 Leetcode38 Count and Say

原題The count-and-say sequence is the sequence of integers with the first five terms as following:1. 1 2. 11 3.

原创 Leetcode167 Two Sum II - Input array is sorted

原題Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a spe