UITableView中默认将空白行也显示出来, 而只需要这句代码即可将其去掉 self.tableView.tableFooterView = UIView(frame: CGRectZero)...
分类:
移动开发 时间:
2015-07-12 19:00:57
阅读次数:
119
该题的思路很简单,就是对BST进行先序遍历,找到第k个数的时候返回。这里借助栈用迭代实现,递归的代码更简单,没有尝试。
class Solution {
public:
int kthSmallest(TreeNode* root, int k) {
stack cache;
TreeNode *point = root;
TreeNode...
分类:
其他好文 时间:
2015-07-12 17:27:38
阅读次数:
85
/* 检测平衡符号 */#include#includestruct stack;typedef struct stack * PtrToStack;struct stack{ char *Array; int TopOfStack; int Capacity;};PtrToSta...
分类:
其他好文 时间:
2015-07-12 17:05:33
阅读次数:
181
Implement Stack using QueuesImplement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the eleme...
分类:
其他好文 时间:
2015-07-12 12:43:16
阅读次数:
112
stack为ADT中的一种数据结构,该结构特点是先进后出,Stack继承了Vector,Vector继承了AbstractList类,由此可见Stack也是集合。他的实现方法一般有两种:一种为单链表(node只有一个next指针的LinkedList),另一种是是数组。jdk中是以数组实现的。1.栈...
分类:
编程语言 时间:
2015-07-11 21:30:51
阅读次数:
241
(积累知识,遇到发展,本文仅用于备忘录,不时它需要召回准备)Problem:依据String的大小来调整Label的frame。在view中又一次更新views的layout并显示。Solution Code Snippets:-(void)updateData{ self.view.laye...
分类:
其他好文 时间:
2015-07-11 20:09:42
阅读次数:
150
为了严格遵循堆栈数据后进先出原则,stack不提供元素的任何迭代操作,因此stack容器不会向外部提供可用的前向或反向迭代器类型。
头文件#include创建stack对象
stack()
默认的构造函数,创建一个空的stack对象。
stack s; //使用默认的deque为底层容器,创建一个空的堆栈对象s。
stack(const stack...
分类:
其他好文 时间:
2015-07-11 12:14:20
阅读次数:
134
按钮
自定义按钮:调整内部子控件的frame
方式1:实现titleRectForContentRect:和imageRectForContentRect:方法,分别返回titleLabel和imageView的frame
方式2:在layoutSubviews方法中设置
内边距
// 设置按钮内容的内边距(影响到imageView和titleLabel)
@property(nonatomic)...
分类:
移动开发 时间:
2015-07-10 23:45:21
阅读次数:
173
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.
push(x) – Push element x onto stack.
pop() – Removes the element on top of the stack.
top() – Get the t...
分类:
其他好文 时间:
2015-07-10 23:45:14
阅读次数:
157
Implement the following operations of a stack using queues.push(x) – Push element x onto stack.
pop() – Removes the element on top of the stack.
top() – Get the top element.
empty() – Return whether...
分类:
其他好文 时间:
2015-07-10 23:45:02
阅读次数:
146