自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 UIScrollView实现图片轮播器的无限滚动

简介在现在的一些App中常常见到图片轮播器,一般用于展示广告、新闻等数据,在iOS内并没有现成的控件直接实现这种功能,但是通过UIScrollView的允许分页设置,可以实现滚动轮播的功能。轮播原理UIScrollView对象有pagingEnable成员,如果设置为YES,那么每一个scrollView尺寸这么大的区域就会被当作一页,在滚动时会根据滚动的比例自动计算应该切换到哪一页。无限滚动原理要

2015-11-30 18:00:38 5804 1

原创 [LeetCode]Additive Number

题目链接:Additive Number题目内容:Additive number is a positive integer whose digits can form additive sequence.A valid additive sequence should contain at least three numbers. Except for the first two numbers,

2015-11-23 14:34:30 1973

原创 [LeetCode]Range Sum Query - Mutable

题目链接:Range Sum Query - Mutable题目内容:Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.The update(i, val) function modifies nums by updating the element

2015-11-20 14:58:33 3805

原创 [LeetCode]Linked List Cycle II

题目链接:Linked List Cycle II题目内容:Given a linked list, return the node where the cycle begins. If there is no cycle, return null.Note: Do not modify the linked list.Follow up: Can you solve it without usi

2015-11-13 14:24:23 587

原创 [LeetCode]Perfect Squares

题目链接:Perfect Squares题目内容:Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n.For example, given n = 12, return 3 be

2015-11-11 15:41:01 716

原创 [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; }

2015-11-07 13:32:39 629

原创 [LeetCode]Serialize and Deserialize Binary Tree

题目链接:Serialize and Deserialize Binary Tree题目内容:Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer

2015-11-06 14:36:51 740

原创 [LeetCode]Binary Tree Zigzag Level Order Traversal

题目链接:Binary Tree Zigzag Level Order Traversal题目内容:Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next le

2015-11-04 15:12:40 698

原创 [LeetCode]Longest Increasing Subsequence

这是一道典型的动态规划问题,通常有两种解法,一种自然的思想时间复杂度为O(n^2),而另一种巧妙地思路可以利用二分查找把时间复杂度降低到O(nlogn)。下面分别介绍这两种做法。

2015-11-03 17:22:37 1601

原创 [LeetCode]Bulls and Cows

题目描述题目要求对secret和guess进行比对,找出bull和cow,bull指的是位置相同且字符相同的情况,cow指的是guess中的数在secret中出现过,但是位置不同。需要特别注意的是多个重复字符的情况,在匹配出一个bull后,那个字符就不能再被cow匹配了,因此需要计数当前还剩下多少个secret字符未被bull匹配。并且bull匹配优先于cow匹配。

2015-11-02 14:47:39 836

空空如也

空空如也

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

TA关注的人

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