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

2016-06-29
LeetCode-Path Sum II

##题目 ####Path Sum II Given a binary tree and a sum, find all root-to-leaf paths where each path’s sum equals the given sum. For example:Given the below binary tree and sum = 22, 5 / \ 4 8 / / \ 11 13 4 / \ / \ 7 2 5 1 return [ [5,4,11,2], [5,8,4,5] ]

Read More

2016-06-29
LeetCode-Permutation Sequence

##题目 ####Permutation Sequence The set [1,2,3,…,n] contains a total of n! unique permutations. By listing and labeling all of the permutations in order,We get the following sequence (ie, for n = 3): "123" "132" "213" "231" "312" "321" Giv

Read More

2016-06-29
LeetCode-Permutations II

##题目 ####Permutations II Given a collection of numbers that might contain duplicates, return all possible unique permutations. For example, [1,1,2] have the following unique permutations: [1,1,2], [1,2,1], and [2,1,1].

Read More

2016-06-29
LeetCode-Plus One

##题目 ####Plus One Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such that the most significant digit is at the head of the list.

Read More

2016-06-29
LeetCode-Permutations

##题目 ####Permutations Given a collection of numbers, return all possible permutations. For example, [1,2,3] have the following permutations: [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], and [3,2,1].

Read More

2016-06-29
LeetCode-Populating Next Right Pointers in Each Node II

##题目 ####Populating Next Right Pointers in Each Node II Follow up for problem “Populating Next Right Pointers in Each Node”. What if the given tree could be any binary tree? Would your previous solution still work? ####Note: You may only use constant extra space. For example,Given the following b

Read More

2016-06-29
LeetCode-Pow(x, n)

##题目 ####Pow(x, n) Implement pow(x, n).

Read More

2016-06-29
LeetCode-Recover Binary Search Tree

##题目 ####Recover Binary Search Tree Two elements of a binary search tree (BST) are swapped by mistake. Recover the tree without changing its structure. ####Note:A solution using O(n) space is pretty straight forward. Could you devise a constant space solution?confused what "{1,#,2,3}" mea

Read More

2016-06-29
LeetCode-Populating Next Right Pointers in Each Node

##题目 ####Populating Next Right Pointers in Each Node Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL. I

Read More

2016-06-29
Redis数据类型

本文主要对Redis的数据类型进行介绍。(来自实验楼)

Read More

2016-06-29
Redis简介与安装

本文主要对Redis进行介绍并讨论其安装过程。(来自实验楼)

Read More

2016-06-29
Redis的高级应用与安全

本文主要讲解Redis的高级应用,包括:安全性设置,主从复制,事务处理, 持久化机制, 虚拟内存的使用。(来自实验楼)

Read More

2016-06-29
Redis系统管理

本文主要对Redis系统管理进行介绍。(来自实验楼)

Read More

2016-06-29
LeetCode-Remove Duplicates from Sorted Array

##题目 ####Remove Duplicates from Sorted Array Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space for another array, you must do this in place with constant memory. For example,Given input array A = [1,1,

Read More

2016-06-29
LeetCode-Remove Duplicates from Sorted Array II

##题目 ####Remove Duplicates from Sorted Array II Follow up for “Remove Duplicates”:What if duplicates are allowed at most twice? For example,Given sorted array A = [1,1,1,2,2,3], Your function should return length = 5, and A is now [1,1,2,2,3].

Read More

2016-06-29
LeetCode-Remove Duplicates from Sorted List II

##题目 ####Remove Duplicates from Sorted List II Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. For example,Given 1->2->3->3->4->4->5, return 1->2->5.Given 1->1->1->2->3, return 2->

Read More

2016-06-29
LeetCode-Remove Duplicates from Sorted List

##题目 ####Remove Duplicates from Sorted List Given a sorted linked list, delete all duplicates such that each element appear only once. For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, return 1->2->3.

Read More

2016-06-29
LeetCode-Remove Element

##题目 ####Remove Element Given an array and a value, remove all instances of that value in place and return the new length. The order of elements can be changed. It doesn’t matter what you leave beyond the new length.

Read More

2016-06-29
LeetCode-Remove Linked List Elements

##题目 ####Remove Linked List Elements Remove all elements from a linked list of integers that have value val. ExampleGiven: 1 –> 2 –> 6 –> 3 –> 4 –> 5 –> 6, val = 6Return: 1 –> 2 –> 3 –> 4 –> 5 Credits:Special thanks to @mithmatt for adding this problem and creating all

Read More

2016-06-29
LeetCode-Remove Nth Node From End of List

##题目 ####Remove Nth Node From End of List Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end, the linked list becomes 1->2->3->5 ####Note: Gi

Read More