自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

早睡早起好少年

为什么坚持 想一想当初

  • 博客(17)
  • 资源 (5)
  • 收藏
  • 关注

原创 leetcode-169-Majority Element

Majority ElementGiven an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-emp

2015-06-30 20:20:47 387

原创 leetcode-51-N-Queens

N-QueensThe n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other.Given an integer n, return all distinct solutions

2015-06-27 00:37:47 536

原创 leetcode-116-Populating Next Right Pointers in Each Node

Populating Next Right Pointers in Each NodGiven a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate

2015-06-26 19:47:37 403

原创 八皇后

八皇后(可以扩展为N皇后问题)每行每列每个对角线都不允许有两个或两个以上的皇后回溯,递归求解#include/// 八皇后#includeusing namespace std;int c[10]; /// 第i行 列为a[i]int total;int n;/// 在一条主对角线上 则它们的 x-y相同 y=x+b/// 在一条负对角线上 则它们的 x+y相

2015-06-23 22:22:20 943

原创 leetcode-52-N-Queens II

N-Queens II Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.n皇后问题 详文请见八皇后leetcode AC代码class

2015-06-23 21:38:00 581

原创 leetcode-206-Reverse Linked List

Reverse Linked ListReverse a singly linked list.click to show more hints.Hint:A linked list can be reversed either iteratively or recursively. Could you implement both?反转一个链表,用栈实现

2015-06-22 23:36:20 425

原创 leetcode-35-Search Insert Position

Search Insert PositionGiven a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume

2015-06-22 22:49:14 383

原创 leetcode-141-Linked List Cycle

Linked List Cycle Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?判断链表是否有环/** * Definition for singly-linked list. *

2015-06-22 22:04:06 385

原创 leetcode-66-Plus One

leetcode

2015-06-22 19:33:04 456

原创 leetcode-226-Invert Binary Tree

Invert Binary TreeInvert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1Trivia:This problem was inspired by this orig

2015-06-21 23:28:08 382

原创 leetcode-94-Binary Tree Inorder Traversal

Binary Tree Preorder Traversal Given a binary tree, return the preorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3

2015-06-21 23:08:45 385

原创 中序遍历

#include ///中序遍历#include#includeusing namespace std;typedef struct Node{ int k; Node *lchild,*rchild;}Node,*Link;Link p;int x;void create(Link& T){ scanf("%d",&x); if(x==-1)

2015-06-21 21:37:31 487

原创 leetcode-217-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 retur

2015-06-21 03:07:19 363

原创 leetcode-136-Single Number

Single Number Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implem

2015-06-21 01:58:44 386

原创 leetcode-191-Number of 1 Bits

Number of 1 BitsWrite a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight).For example, the 32-bit integer ’11'

2015-06-21 01:51:10 261

原创 leetcode-100-Same Tree

Same TreeGiven two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical and the nodes have the

2015-06-21 01:40:35 375

原创 leetcode-104-Maximum Depth of Binary Tree

Maximum Depth of Binary TreeGiven a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf nod

2015-06-20 13:10:25 469

[溜客资源论坛提供]C++黑客编程揭秘与防范

黑客资料,了解Hacker,覆盖知识广,有兴趣可以看一下

2014-11-13

微软面试100题

经典的微软面试100题,详细讲解,对算法的学习大有帮组,对即将面试的同学更是不用说。

2014-08-27

c/c++语言参考

包含c++各种库函数,以及c的函数,c++中STL里的各种函数用法,很经典,即可作为入门基础,又可以当做工具书。

2014-08-27

UNIX环境高级编程(第二版)

UNIX操作系统,讲的很详细,适合新手, 绝对不坑

2014-08-20

《算法导论》

《算法导论》是一部很经典的书,里面包含了许多算法知识,深入浅出,图论,搜索,数据结构,应有尽有。对搞ACM的帮组极大。

2014-08-15

空空如也

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

TA关注的人

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