### leetcode题解 面试算法

16 已关注
76篇博文
• #### leetcode：Rotate Image （旋转矩阵）【面试算法题】

题目： You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clock...

2013-12-03 20:03
4652
• #### leetcode：Reverse Nodes in k-Group（以k为循环节反转链表）【面试算法题】

题目： Given a linked list, reverse the nodes of a linked list k at a time and return its modified li...

2013-12-02 23:08
1795
• #### leetcode：Reverse Linked List II （反转链表中的一部分）【面试算法题】

题目： Reverse a linked list from position m to n. Do it in-place and in one-pass. For example:...

2013-11-29 19:42
2006
• #### leetcode：Reverse Integer（反转数字）【算法面试题】

题目： Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return ...

2013-11-28 22:31
2429
• #### leetcode:Restore IP Addresses (修复ip地址) 【面试算法题】

题目： Given a string containing only digits, restore it by returning all possible valid IP addres...

2013-11-28 21:29
1521
• #### leetcode:Reorder List (修改链表排列不改变值) 【面试算法题】

题目： Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must...

2013-11-28 20:10
1384
• #### leetcode：Remove Nth Node From End of List（删除链表倒数第n个节点）【面试算法题】

题目： Given a linked list, remove the nth node from the end of list and return its head. 题意删除链表中倒数第n个节...

2013-10-21 21:42
2129
• #### leetcode：Remove Duplicates from Sorted List II （留下链表中只出现一次的元素）【面试算法题】

题目： Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct ...

2013-10-20 13:30
4603
• #### leetcode：Remove Element （删除给定元素）【面试算法题】

题目： Given an array and a value, remove all instances of that value in place and return the new lengt...

2013-10-20 19:13
13389
• #### leetcode：Remove Duplicates from Sorted List（去除链表中重复元素）【面试算法题】

题目： Given a sorted linked list, delete all duplicates such that each element appear only once. 题意去掉链...

2013-10-20 11:44
3526
• #### leetcode：Remove Duplicates from Sorted Array II （允许重复一次，去掉数组多余数字）【面试算法题】

题目： Follow up for "Remove Duplicates": What if duplicates are allowed at most twice? For example, Gi...

2013-10-19 16:20
4340
• #### leetcode：Remove Duplicates from Sorted Array（去掉数组重复数字，常数空间限制）【面试算法题】

题目：Given a sorted array, remove the duplicates in place such that each element appear only once and ...

2013-10-19 15:45
5001
• #### leetcode：Recover Binary Search Tree （修正二叉查找树错误节点，不改变结构）【面试算法题】

题目：Two elements of a binary search tree (BST) are swapped by mistake. Recover the tree without chang...

2013-10-19 11:13
7709
• #### leetcode：Pow(x, n) （计算x的n次方） 【面试算法题】

题目：Implement pow(x, n). 题意计算x的n次方，考虑复杂度和n的取值。

2013-10-18 15:02
10164
• #### leetcode：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...

2013-10-18 10:40
3363
• #### leetcode：Populating Next Right Pointers in Each Node（常数空间，连接二叉树每一层所有节点）【面试算法题】

题目：Populate each next pointer to point to its next right node. If there is no next right node, the n...

2013-10-17 17:53
3543
• #### leetcode：Plus One （加一）【面试算法题】

题目：Given a number represented as an array of digits, plus one to the number. 题意动态数组存了一些个位数字，组成一个大数，计...

2013-10-17 17:17
9234
• #### leetcode：Permutations II （序列所有无重复排列）【面试算法题】

题目： Given a collection of numbers that might contain duplicates, return all possible unique permutat...

2013-10-17 16:03
7615
• #### leetcode：Permutations （序列所有排列）【面试算法题】

题目： Given a collection of numbers, return all possible permutations. 题意输出给定序列的所有排列。

2013-10-17 15:49
6077
• #### leetcode:Permutation Sequence (顺序排列第k个序列) 【面试算法题】

题目：The set [1,2,3,…,n] contains a total of n! unique permutations. By listing and labeling all of th...

2013-10-17 15:15
7097