程序员的世界, 为程序员服务

2016-06-29
Tachyon如何解决spark中的数据共享和缓存问题

Tachyon是一款基于内存的分布式文件系统,主要致力于解决不同计算框架之间的数据共享问题。 基于内存的特性减少了不同计算框架依赖底层存储系统,如HDFS,带来的磁盘和网络IO问题。而且起初的目标主要是在spark生态系统中,解决不同application之间的RDD共享问题,后来演化成一个独立的项目,解决不同类型应用间数据共享问题。

Read More

2016-06-29
LeetCode-Text Justification

##题目 ####Text Justification Given an array of words and a length L, format the text such that each line has exactly L characters and is fully (left and right) justified. You should pack your words in a greedy approach; that is, pack as many words as you can in each line. Pad extra spaces ‘ ‘ when n

Read More

2016-06-29
LeetCode-The Skyline Problem

##题目 ####The Skyline Problem A city’s skyline is the outer contour of the silhouette formed by all the buildings in that city when viewed from a distance. Now suppose you are given the locations and height of all the buildings as shown on a cityscape photo (Figure A), write a program to output the

Read More

2016-06-29
LeetCode-4Sum

##题目 ####4Sum Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target. ####Note: Elements in a quadruplet (a,b,c,d) must be in non-descending order. (ie, a ≤ b ≤ c ≤ d) The solu

Read More

2016-06-29
LeetCode-Trapping Rain Water

##题目 ####Trapping Rain Water Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining. For example,Given [0,1,0,2,1,0,1,3,2,1,2,1], return 6. The above elevation map is represented by array [0,1,0,2,1,0,1

Read More

2016-06-29
LeetCode-Triangle

##题目 ####Triangle Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given the following triangle [ [2], [3,4], [6,5,7], [4,1,8,3] ] The minimum path sum from top to bottom is 11 (i.e., 2 + 3 + 5

Read More

2016-06-29
LeetCode-Unique Binary Search Trees II

##题目 ####Unique Binary Search Trees II Given n, generate all structurally unique BST’s (binary search trees) that store values 1…n. For example,Given n = 3, your program should return all 5 unique BST’s shown below. 1 3 3 2 1 \ / / / \ \ 3 2 1

Read More

2016-06-29
LeetCode-Unique Paths II

##题目 ####Unique Paths II Follow up for “Unique Paths”: Now consider if some obstacles are added to the grids. How many unique paths would there be? An obstacle and empty space is marked as 1 and 0 respectively in the grid. For example,There is one obstacle in the middle of a 3x3 grid as illustrated

Read More

2016-06-29
LeetCode-Unique Binary Search Trees

##题目 ####Unique Binary Search Trees Given n, how many structurally unique BST’s (binary search trees) that store values 1…n? For example,Given n = 3, there are a total of 5 unique BST’s. 1 3 3 2 1 \ / / / \ \ 3 2 1 1 3 2 / /

Read More

2016-06-29
LeetCode-Unique Paths

##题目 ####Unique Paths A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below). The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid (marked ‘Finish’ in the diagram below). How many

Read More

2016-06-29
利用Docker搭载本地的spark环境

最近换了新电脑,需要配置一下本地的spark环境,为了方便一次配置,到处运行,本文采用docker的容器机制来搭建本地的spark环境。 本人涉及docker不深,如有错误,希望大家多多包涵指教!么么哒,大家!

Read More

2016-06-29
LeetCode-Valid Palindrome

##题目 ####Valid Palindrome Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,"A man, a plan, a canal: Panama" is a palindrome."race a car" is not a palindrome. ####Note:Have you consider that the string might

Read More

2016-06-29
LeetCode-Valid Number

##题目 ####Valid Number Validate if a given string is numeric. Some examples:"0" => true" 0.1 " => true"abc" => false"1 a" => false"2e10" => true Note: It is intended for the problem statement to be ambiguous. You should gather all r

Read More

2016-06-29
LeetCode-Valid Parentheses

##题目 ####RValid Parentheses Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the correct order, "()" and "()[]{}" are all valid but &q

Read More

2016-06-29
LeetCode-Valid Sudoku

##题目 ####Valid Sudoku Determine if a Sudoku is valid, according to:Sudoku Puzzles - The Rules. The Sudoku board could be partially filled, where empty cells are filled with the character ‘.’. A partially filled sudoku which is valid. ####Note: A valid Sudoku board (partially filled) is not necessa

Read More

2016-06-29
LeetCode-Validate Binary Search Tree

##题目 ####Validate Binary Search Tree Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only nodes with keys less than the node’s key. The right subtree of a node contains only nodes with keys greater

Read More

2016-06-29
LeetCode-Wildcard Matching

##题目 ####Wildcard Matching Implement wildcard pattern matching with support for '?' and '*'. '?' Matches any single character. '*' Matches any sequence of characters (including the empty sequence). The matching should cover the entire input string (not partial).

Read More

2016-06-29
LeetCode-Word Break II

##题目 ####Word Break II Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word. Return all such possible sentences. For example, givens = "catsanddog",dict = ["cat", "cats", "and", &q

Read More

2016-06-29
LeetCode-Word Break

##题目 ####Word Break Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words. For example, givens = "leetcode",dict = ["leet", "code"]. Return true because "leetcode&qu

Read More

2016-06-29
LeetCode-Word Ladder II

##题目 ####Word Ladder II Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from start to end, such that: Only one letter can be changed at a time Each intermediate word must exist in the dictionaryFor example, Given:start = "hit"end = "

Read More