自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

AlwaysCoding的专栏

拥有一颗上进的心。

  • 博客(8)
  • 收藏
  • 关注

原创 [leetcode]twoSum

Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers such that they add up to the target, whe

2013-12-21 21:24:58 769

原创 二叉树的各种递归和栈的遍历。

#include#include#includeusing namespace std;struct node{ int data; node*left; node*right; node(int x) :data(x), left(nullptr), right(nullptr){}};//新建节点node*newNode(int elem){ node*cur = n

2013-12-18 00:05:14 918

原创 Value Palindrome

运用了STL函数。#include#includeusing namespace std;bool isPalindrome1(string text){ text.erase(remove_if(text.begin(), text.end(), [](char c){ //lambda return !isalpha(c) ; }), text.end());

2013-12-11 10:14:51 740

原创 二叉树的先序遍历

二叉树的先序遍历。递归和迭代两种方法,感觉写迭代的是时候好多废话,懒得改了。停几天再改#include#include#includeusing namespace std;struct node{ int data; node*left; node*right; node(int x) :data(x), left(nullptr), right(nullptr){}};

2013-12-10 21:43:32 865

原创 一些BST基础知识

又看了一遍BST,把这些基础写了下来。分享一下。代码测试通过。#include#include#includeusing namespace std;struct TreeNode{ int val; TreeNode*left; TreeNode*right; TreeNode(int x) :val(x), left(NULL), right(NULL){}};TreeNo

2013-12-10 19:50:17 883

原创 [leetcode]SameTree

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

2013-12-10 10:52:34 818

原创 [LeetCode]3sum

#include#include#includeusing namespace std;class solution{public:vector > threesum(vector& num){vector > result;if(num.size()   sort(num.begin(),num.end());const int target=0;

2013-11-03 19:46:24 943

原创 leetcode(longest consecutive sequence)

Longest Consecutive Sequence Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given [100, 4, 200, 1, 3, 2],The longest

2013-11-03 19:16:56 734

空空如也

空空如也

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

TA关注的人

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