原创 【Leetcode長征系列】Sqrt(x)

原題: Implement int sqrt(int x). Compute and return the square root of x. ==============================以下爲引用===========

原创 【Leetcode長征系列】Convert Sorted List to Binary Search Tree

原題: Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. 思路:和處

原创 【Leetcode長征系列】Pow(x, n)

原題: Implement pow(x, n). 思路:遞歸計算pow。 class Solution { public: double pow(double x, int n) { long long int mi

原创 The striping and assembly algorithms from the Dremel paper( from github, project parquet-mr )

爲了理解Dremel論文中給出的案例,筆者覺得對定義級別和重複級別這兩個概念進行註釋加強理解是有必要的,具體可以看Dremel那篇論文的圖2和圖3。 柱狀數據的嵌套模式: 論文使用了以下的模型: message Document {  

原创 【Leetcode長征系列】Add Binary

原題: Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100". 思路:

原创 【Leetcode長征系列】Evaluate Reverse Polish Notation

原題: Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +,

原创 【Leetcode長征系列】Best Time to Buy and Sell Stock

原題: Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted

原创 【Leetcode長征系列】Unique Binary Search Trees II

原題: Given n, generate all structurally unique BST's (binary search trees) that store values 1...n. For example, Given

原创 【Leetcode長征系列】Longest Common Prefix

原題: Write a function to find the longest common prefix string amongst an array of strings. 思路:pre賦給第一個strs值,然後和後面的strin

原创 【Leetcode長征系列】Reverse Words in a String

原題: Given an input string, reverse the string word by word. For example, Given s = "the sky is blue", return "blue is