自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(7)
  • 收藏
  • 关注

原创 leetcode由易入难——【6】Count and Say

 The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, ... 1 is read off as "one 1" or 11. 11 is read off as "two 1s" or 21. 21 is read off as "

2015-06-29 20:10:01 454

转载 leetcode由易入难——【5】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

2015-06-26 10:33:05 227

原创 leetcode由易入难——【4】Decode Ways

 A message containing letters from A-Z is being encoded to numbers using the following mapping: 'A' -> 1 'B' -> 2 ... 'Z' -> 26Given an encoded message containing digits, determine the total num

2015-06-26 09:43:16 677

原创 leetcode由易入难——【3】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? 分析 设f(n)表示爬n阶楼梯的不同方法数

2015-06-26 09:36:24 302

原创 DFS(深度优先搜索)解析

1.1 Balanced Binary Tree(平衡二叉树)     平衡二叉树又被称为AVL树(有别于AVL算法),且具有以下性质:它是一 棵空树或它的左右两个子树的高度差的绝对值不超过1,并且左右两个子树都是一棵平衡二叉树。常用算法有红黑树、AVL、Treap、伸展树等。在平衡二叉搜索树中,我们可以看到,其高度一般都良好地维持在O(log2n),大大降低了操作的时间复杂度。

2015-06-25 16:07:42 382

原创 leetcode由易入难——【2】Balanced Binary Tree

Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never d

2015-06-25 15:28:33 368

原创 leetcode由易入难——【1】Add Binary

Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100".

2015-06-25 14:24:49 328

空空如也

空空如也

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

TA关注的人

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