原创 ubuntu14.04下利用源代碼安裝配置postgresql

最近在複習數據庫基礎,於是從頭開始整理一些相關知識,爲了方便做實驗,首先就是在ubuntu14.04上安裝postgresql。以下是詳細步驟: 1、下載最新版的postgresql源碼到本地(選擇後綴爲.tar.gz的),下載地址:ht

原创 Subsets - LeetCode 78

題目描述: Given a set of distinct integers, nums, return all possible subsets.

原创 Reorder List - LeetCode 143

題目描述: Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→

原创 Invert Binary Tree - LeetCode 226

題目描述:Invert a binary tree.      4    /   \   2     7  / \   / \ 1   3 6  

原创 Binary Tree Right Side View - LeetCode 199

題目描述: Given a binary tree, imagine yourself standing on the right side of

原创 Sort List - LeetCode 148

題目描述 : Sort a linked list in O(n log n) time using constant space complexity.Hide Tags Linked List Sor

原创 Best Time to Buy and Sell Stock III - LeetCode 123

Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to fi

原创 Perfect Squares - LeetCode 279

Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) whic

原创 Path Sum II - LeetCode 113

題目描述: Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. For exampl

原创 Gas Station - LeetCode 134

There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You have a car

原创 Product of Array Except Self - LeetCode 238

Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the prod

原创 Search for a Range - LeetCode 34

題目描述: Given a sorted array of integers, find the starting and ending position of a given target value.

原创 First Missing Positive - LeetCode 41

題目描述: Given an unsorted integer array, find the first missing positive integer. For example, Given [1,

原创 Summary Ranges - LeetCode 228

題目描述: Given a sorted integer array without duplicates, return the summary of its ranges.For example, g

原创 Median of Two Sorted Arrays - LeetCode 4

題目描述: There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the