#include#includeusing namespace std;int main(){
//初始化10个元素,每个值都为0 vector fvec(10); //输出 for(vector::size_type
ix=0;ix!=fvec.size();ix++) ...
分类:
其他好文 时间:
2014-05-08 18:44:26
阅读次数:
528
题目链接在这题各种RE和WA。 方法上就是BFS,
还是基础不扎实的原因,很明显的一点就是这里使用二维vector, 开始的时候我竟然没有给ans分配空间,然后直接push_back,
导致RE到死。这点是必须引起注意的!附上代码: 1 /** 2 * Definition for binary ....
分类:
其他好文 时间:
2014-05-08 18:00:37
阅读次数:
292
题目链接附上代码: 1 #include 2 #include 3 #include 4 using
namespace std; 5 6 class Solution { 7 public: 8 vector twoSum(vector
&numbers, int target) ...
分类:
其他好文 时间:
2014-05-08 17:50:11
阅读次数:
253
如果OS为windows 7 64位系统,Oracle版本为 Oracle 11g 64
安装PL SQL Developer
请参考http://myskynet.blog.51cto.com/1471053/623957http://support.microsoft.com/kb/258554...
分类:
数据库 时间:
2014-05-08 14:49:05
阅读次数:
450
很简单的题目,在想是不是后面就不要更这么简答的了,大家都会写,没人看啊。层序遍历的基础上,加了保存每一层,加了从下往上输出,就是一个vector和一个stack的问题嘛,无他,但手熟尔。
class Solution {
public:
vector > levelOrderBottom(TreeNode *root) {
vector > res;
if...
分类:
其他好文 时间:
2014-05-08 11:17:46
阅读次数:
268
在更新上面一道题的时候我就想,是不是还有一道打印路径的,果不其然啊。
这种题非常常见的,做法也很简单,我是用一个引用的vector来存,满足条件之后直接压入结果集中,当然也可以用数组之类的,都一样。用引用需要注意的问题就是递归进行到后面的时候会对栈中的上层状态产生影响,当然可以用传值的方法来避免这个问题,但是那样子开销太大了(每次船建和销毁一个类对象,不是明智的选择)。那么就是要回退,那什么时候...
分类:
其他好文 时间:
2014-05-08 11:03:31
阅读次数:
248
class Solution{ public: int maxArea(vector&
height) { int len = height.size(), low = 0, high = len -1 ; int maxArea = 0; ...
分类:
其他好文 时间:
2014-05-08 10:23:54
阅读次数:
287
https://www.devexpress.com/Support/Center/Example/Details/E911
这段代码用的是ViewPager+自定义控件技术实现的广告指示器滑动效果先展示下主要代码以及效果后面会附上源代码的BannerFragment.javapackagecom.example.ex_templete;
importandroid.os.Bundle;
importandroid.support.v4.app.Fragment;
importandroid.support.v4.app.FragmentM..
分类:
其他好文 时间:
2014-05-08 03:11:31
阅读次数:
356