原创 [US Giants] 三. Binary Search

Sqrt(x):點擊打開鏈接 Implement int sqrt(int x). Compute and return the square root of x. Example sqrt(3) = 1 sqrt(4) =

原创 [US Giants] 七. Binary Tree

Balanced Binary Tree Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced bin

原创 [Microsoft] Identical Binary Tree

Check if two binary trees are identical. Identical means the two binary trees have the same structure and every ident

原创 [LeetCode] 191. Number of 1 Bits

Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming w

原创 Duplicate問題

219. Contains Duplicate II Given an array of integers and an integer k, find out whether there are two distinct indices

原创 [ShuaTi]

686. Repeated String Match class Solution { public int repeatedStringMatch(String A, String B) { if(A == n

原创 Java Application run

原创 [Postgre SQL] postgre sql

參考此tutorial:http://gitbook.net/postgresql/2013080439.html1. 直接打開SQL Shell (psql)2. 點回車直到如下1. create  database database-

原创 [Server] Redis初應用

前提:install redis successfully或者

原创 [Mongodb]mongodb import json

前提:要導入的json文件數據放在mongo/bin目錄下,路徑一定要放對 cd mongo/bin ./mongoimport -d db名稱 -c collection名稱 --jsonArray data.json 結果:d

原创 [Spring Boot] Spring Boot Actuator

前提:建好Spring Starting Project 1. src/main/resources目錄裏的application.properties里加 server.port: 9000 management.port: 9001

原创 [spring Boot] how to package and run Spring Boot application as a JAR file

前提:進入到當前project的目錄下 1. mvn clean install 2. java -jar target/文件名-0.0.1-SNAPSHOT.jar

原创 [Git] Git初應用

條件:在gitHub上已經創建了新的repository:Web-Programming,並且創建的同時 initialize this repository with a  README Add .gitignore: Node Add

原创 [MongoDB] Mongodb的初應用

前提:下載好mongodb,然後把下載下來的文件夾改爲mongo,並將文件夾移到自己用的地方,在同一個路徑下創建mongo-data文件夾 要做:初次連接並小測試下mongodb 步驟: cd mongo/bin ./mongod --d

原创 [US Giants] 十. Data Structure

Longest Consecutive Sequence Given an unsorted array of integers, find the length of the longest consecutive elements