自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(287)
  • 收藏
  • 关注

转载 Presto架构及原理

Presto 是 Facebook 推出的一个基于Java开发的大数据分布式 SQL 查询引擎,可对从数 G 到数 P 的大数据进行交互式的查询,查询的速度达到商业数据仓库的级别,据称该引擎的性能是 Hive 的 10 倍以上。Presto 可以查询包括 Hive、Cassandra 甚至是一些商业的数据存储产品,单个 Presto 查询可合并来自多个数据源的数据进行统一分析。Presto 的目标...

2019-10-22 21:01:39 645

原创 Super Ugly Number -- leetcode

Write a program to find the nth super ugly number.Super ugly numbers are positive numbers whose all prime factors are in the given prime list primes of size k. For example, [1, 2, 4, 7, 8, 13,

2016-10-07 17:08:39 502

转载 跳表SkipList

原文地址:http://www.cnblogs.com/xuqiang/archive/2011/05/22/2053516.html跳表SkipList1.聊一聊跳表作者的其人其事2. 言归正传,跳表简介3. 跳表数据存储模型4. 跳表的代码实现分析5. 论文,代码下载及参考资料 . 聊一聊作者的其人其事 跳表是由Wil

2016-09-16 19:42:46 404

转载 LevelDb日知录

文章来自朗格科技http://www.samecity.com/LevelDb日知录之一:初识LevelDb            说起LevelDb也许您不清楚,但是如果作为IT工程师,不知道下面两位大神级别的工程师,那您的领导估计会Hold不住了:Jeff Dean和Sanjay Ghemawat。这两位是Google公司重量级的工程师,为数甚少的Google

2016-09-16 18:05:24 893

原创 Minimum Height Trees -- Leetcode

For a undirected graph with tree characteristics, we can choose any node as the root. The result graph is then a rooted tree. Among all possible rooted trees, those with minimum height are called mini

2016-09-16 12:57:32 295

原创 Range Sum Query - Mutable -- Leetcode

Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.The update(i, val) function modifies nums by updating the element at index i to val.Examp

2016-08-14 20:03:09 366

原创 Additive Number -- leetcode

Additive number is a string whose digits can form additive sequence.A valid additive sequence should contain at least three numbers. Except for the first two numbers, each subsequent number in the

2016-08-07 17:37:32 321

转载 The Log-Structured Merge-Tree

作者:Patrick O’Neil &Edward Cheng etc. 1996原文:http://www.springerlink.com/content/rfkpd5yej9v5chrp/译者:phylips@bmy 2011-12-25译文:http://duanple.blog.163.com/blog/static/7097176720120391321283/

2016-08-07 11:24:45 455

原创 Range Sum Query 2D -- leetcode

Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper left corner (row1, col1) and lower right corner (row2, col2).The above rectangle (with the red bo

2016-07-24 18:04:28 214

原创 Remove Invalid Parentheses -- Leetcode

Remove the minimum number of invalid parentheses in order to make the input string valid. Return all possible results.Note: The input string may contain letters other than the parentheses ( and ).

2016-07-17 21:14:55 437

原创 Longest Increasing Subsequence -- Leetcode

Given an unsorted array of integers, find the length of longest increasing subsequence.For example,Given [10, 9, 2, 5, 3, 7, 101, 18],The longest increasing subsequence is [2, 3, 7, 101], ther

2016-07-17 09:20:19 277

原创 Bulls and Cows -- leetcode

You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess what the number is. Each time your friend makes a guess, you provide a hint t

2016-07-09 21:12:28 308

原创 Serialize and Deserialize Binary Tree -- leetcode

Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network connection link to be

2016-07-09 19:28:22 304

原创 Find Median from Data Stream -- Leetcode

Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two middle value.Examples: [2,3,4] , the median

2016-07-02 21:35:38 303

原创 Nim Game -- leetcode

You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The one who removes the last stone will be the

2016-07-02 19:50:02 243

原创 Word Pattern -- Leetcode

Given a pattern and a string str, find if str follows the same pattern.Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empty word in str.

2016-07-02 18:51:25 258

原创 Game of Life -- leetcode

According to the Wikipedia's article: "The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970."Given a board with m 

2016-06-26 18:12:11 335

转载 正则表达式30分钟入门教程

目录跳过目录本文目标如何使用本教程正则表达式到 底是什么东西?入门测试正则表达式元字符字符转义重复字符类分枝条件反义分组后向引用零宽断言负 向零宽断言注释贪婪与懒惰处理选项平衡组/递 归匹配还 有些什么东西没提到联系作者最 后,来点广告……网上的资源及本文参 考文献更新纪录本文目标30分钟内让你明白正则表达式是什么,并对它有一些基本的了解,让你可以在自己的程序或网页里使用它

2015-10-18 09:31:46 299

原创 Peeking Iterator -- leetcode

Given an Iterator class interface with methods: next() and hasNext(), design and implement a PeekingIterator that support the peek() operation -- it essentially peek() at the element that will be

2015-10-14 16:58:12 421

原创 Move Zeroes -- leetcode

Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements.For example, given nums = [0, 1, 0, 3, 12], after calling you

2015-10-14 16:03:23 290

原创 Expression Add Operators -- leetcode

算法一,每得到一个新的整数,对其进行+, -, *三种运算。使用dfs递归,免去重复计算。此处使用sum, mul两个变量记录中间结果。 sum 存储累加和, mul 存储乘积结果。之所以用两个,是基于如下情况:1. 当我们在一个整数前添加+号时, 此整数后面紧跟的是*运算的话,我们则不能将此整数运算到sum中2. -号同上3. 当添加*时,我们只需要将该整数累乘进mu

2015-10-14 10:19:42 482

原创 Perfect Squares -- leetcode

Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n.For example, given n = 12, return 3 because 12 = 4 + 4 + 4; given n =

2015-10-10 13:42:34 821

原创 First Bad Version -- leetcode

You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the

2015-10-09 11:51:07 385

原创 H-Index II -- leetcode

Follow up for H-Index: What if the citations array is sorted in ascending order? Could you optimize your algorithm?基本思路:折半查找1. 选取中间点,判断该处是否满足hIndex定义2. 如果满足定义,则在左区间继续搜索,以找到更大的hIndex3

2015-10-05 15:08:42 326

原创 H-Index -- leetcode

Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index.According to the definition of h-index on Wikipedia: "A

2015-10-05 10:42:45 628

原创 Integer to English Words -- leetcode

Convert a non-negative integer to its english words representation. Given input is guaranteed to be less than 231 - 1.For example,123 -> "One Hundred Twenty Three"12345 -> "Twelve Thousand Th

2015-10-04 12:58:33 384

原创 Missing Number -- leetcode

Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array.For example,Given nums = [0, 1, 3] return 2.Note:Your algorithm shoul

2015-10-03 19:46:01 516

原创 Ugly Number II -- leetcode

Write a program to find the n-th ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 1, 2, 3, 4, 5, 6, 8, 9, 10, 12 is the sequence of the first 

2015-10-03 18:05:17 344

原创 Ugly Number -- leetcode

Write a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 6, 8 are ugly while 14 is not ugly sinc

2015-10-03 14:46:30 306

原创 Single Number III -- leetcode

Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once.For example:Given 

2015-10-02 15:33:37 263

原创 Add Digits -- leetcode

Given a non-negative integer num, repeatedly add all its digits until the result has only one digit.For example:Given num = 38, the process is like: 3 + 8 = 11, 1 + 1 = 2. Since 2 has on

2015-10-02 13:46:03 302

原创 Binary Tree Paths -- leetcode

Given a binary tree, return all root-to-leaf paths.For example, given the following binary tree: 1 / \2 3 \ 5All root-to-leaf paths are:["1->2->5", "1->3"]

2015-10-02 12:13:52 276

原创 Valid Anagram -- leetcode

Given two strings s and t, write a function to determine if t is an anagram of s.For example,s = "anagram", t = "nagaram", return true.s = "rat", t = "car", return false.Note:You may ass

2015-10-02 10:37:44 292

原创 Different Ways to Add Parentheses -- leetcode

Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. The valid operators are +,- and *.Example 1I

2015-10-01 11:34:43 340

原创 Search a 2D Matrix II -- leetcode

Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted in ascending from left to right.Integers in

2015-09-29 21:51:36 352

原创 Delete Node in a Linked List -- leetcode

Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed the linked list is 1 -> 2 -> 3 -> 4 and you are given the third node with val

2015-09-25 11:26:58 317

原创 Lowest Common Ancestor of a Binary Tree -- leetcode

Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two node

2015-09-25 11:06:17 317

原创 Lowest Common Ancestor of a Binary Search Tree -- leetcode

Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined betw

2015-09-22 16:32:16 339

原创 Palindrome Linked List -- leetcode

Given a singly linked list, determine if it is a palindrome.Follow up:Could you do it in O(n) time and O(1) space?基本思路:1. 先用快慢指针,找到链表的中间结点。2. 将后半段进行逆转3. 将前半段和经过逆转的后半段进行逐个比较。此题不得不修改

2015-09-20 17:34:07 348

原创 Number of Digit One -- leetcode

Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n.For example:Given n = 13,Return 6, because digit 1 occurred in the followin

2015-09-19 21:04:53 535

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除