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

2016-06-29
LeetCode-Binary Tree Right Side View

##题目 ####Binary Tree Right Side View Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. For example:Given the following binary tree, 1 <--- / \ 2 3 <--- \ \ 5 4

Read More

2016-06-29
LeetCode-Bitwise AND of Numbers Range

##题目 ####Bitwise AND of Numbers Range Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of all numbers in this range, inclusive. For example, given the range [5, 7], you should return 4. ####Credits:Special thanks to @amrsaqr for adding this problem and creating

Read More

2016-06-29
CentOS6.5使用YUM安装Adobe Flash Player

##引言CentOS自带的火狐浏览器没有预装Flash,因此这里需要自己安装。

Read More

2016-06-29
CentOS 常用命令及快捷键整理

##引言最近用linux的比较多,主要用的linux distributions是CentOS.因此这里将CentOS中常用的命令和快捷键进行了整理。

Read More

2016-06-29
LeetCode-Candy

##题目 ####Candy There are N children standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the following requirements: Each child must have at least one candy. Children with a higher rating get more candies than their neighbors. What

Read More

2016-06-29
CentOS-Sublime2安装

##引言Sublime编辑器据说也是一种神级编辑器,所以今天就安装试了试,果然非常不错。

Read More

2016-06-29
LeetCode-Climbing Stairs

##题目 ####Climbing Stairs You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?

Read More

2016-06-29
CentOS下配置"Unix环境高级编程第三版"中的apue.h

##引言最近在看<>,其中代码中都包含了apue.h头文件。因此如果想用这个头文件,需要自己配置。

Read More

2016-06-29
LeetCode-Combination Sum II

##题目 ####Combination Sum II Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. Each number in C may only be used once in the combination. ####Note: All numbers (including target) will be positive integers. E

Read More

2016-06-29
LeetCode-Clone Graph

##题目 ####Clone Graph Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors. ####OJ’s undirected graph serialization:Nodes are labeled uniquely. We use # as a separator for each node, and , as a separator for node label and each neighbor of the node.As an exa

Read More

2016-06-29
LeetCode-Combination Sum

##题目 ####Combination Sum Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same repeated number may be chosen from C unlimited number of times. ####Note: All numbers (including target) will be positive integer

Read More

2016-06-29
LeetCode-Combination Sum III

##题目 ####Combination Sum III Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be a unique set of numbers. Ensure that numbers within the set are sorted in ascending order. Example 1: Input: k = 3, n =

Read More

2016-06-29
LeetCode-Combinations

##题目 ####Combinations Given two integers n and k, return all possible combinations of k numbers out of 1 … n. For example,If n = 4 and k = 2, a solution is: [ [2,4], [3,4], [2,3], [1,2], [1,3], [1,4], ]

Read More

2016-06-29
LeetCode-Combine Two Tables

##题目 ####Combine Two Tables Table: Person +-------------+---------+ | Column Name | Type | +-------------+---------+ | PersonId | int | | FirstName | varchar | | LastName | varchar | +-------------+---------+ PersonId is the primary key column for this table. Table: Address +--------

Read More

2016-06-29
LeetCode-Compare Version Numbers

##题目 ####Compare Version Numbers Compare two version numbers version1 and version2.If version1 > version2 return 1, if version1 < version2 return -1, otherwise return 0. You may assume that the version strings are non-empty and contain only digits and the . character.The . character does not

Read More

2016-06-29
LeetCode-Construct Binary Tree from Inorder and Postorder Traversal

##题目 ####Construct Binary Tree from Inorder and Postorder Traversal Given inorder and postorder traversal of a tree, construct the binary tree. ####Note:You may assume that duplicates do not exist in the tree.

Read More

2016-06-29
LeetCode-Construct Binary Tree from Preorder and Inorder Traversal

##题目 ####Construct Binary Tree from Preorder and Inorder Traversal Given preorder and inorder traversal of a tree, construct the binary tree. ####Note:You may assume that duplicates do not exist in the tree.

Read More

2016-06-29
LeetCode-Contains Duplicate II

##题目 ####Contains Duplicate II Given an array of integers and an integer k, find out whether there there are two distinct indices i and j in the array such that nums[i] = nums[j] and the difference between i and j is at most k.

Read More

2016-06-29
LeetCode-Contains Duplicate

##题目 ####Contains Duplicate Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every element is distinct.

Read More

2016-06-29
LeetCode-Convert Sorted Array to Binary Search Tree

##题目 ####Convert Sorted Array to Binary Search Tree Given an array where elements are sorted in ascending order, convert it to a height balanced BST.

Read More