码迷,mamicode.com
首页 >  
搜索关键字:val    ( 23217个结果
部分链表操作总结
部分链表操作总结#include #include using namespace std;// definition of Node struct Node { int val; Node *next; Node(int x) : val(x), next(NULL){} };// create a linklist with n...
分类:其他好文   时间:2015-07-20 19:35:54    阅读次数:69
【算法学习笔记】78. STL二分的练习 下标映射的处理技巧 SJTU OJ 1053 二哥的内存
水题也要优化1.用两个数组单独记录下标的更新2.用STL中lower_bound来进行二分查找.要注意lower_bound的返回值意义 是大于等于val的第一个,所以返回值要进行判断才可以利用#include #include #include #include using namespace s...
分类:编程语言   时间:2015-07-20 18:56:06    阅读次数:185
AndroidJNI.SetObjectField 设置对象域
staticfunctionSetObjectField(obj:IntPtr,fieldID:IntPtr,val:IntPtr):voidDescription描述Thisfunctionsetsthevalueofaninstance(nonstatic)fieldofanobject.这个函数设置一个对象实例(非静态)域的值。Thevaluetosetisareferencetoeitherajava.lang.Object,orasubclassther..
分类:移动开发   时间:2015-07-20 16:53:53    阅读次数:199
poj 3280 区间dp
题意:给你m个字符,其中有n种字符,每种字符都有两个值,分别是增加一个这样的字符的代价,删除一个这样的字符的代价,让你求将原先给出的那串字符变成回文串的最小代价。 思路:区间dp 设dp[i][j]表示从i到j区间满足条件的最优解 状态方程: if(str[i]==str[j])dp[i][j]=dp[i+1][j-1]; else dp[i][j]=min(dp[i+1][j]+val...
分类:其他好文   时间:2015-07-20 16:25:30    阅读次数:74
上传图片的回调函数,callback作为一个函数针对回调函数
Tool.ImageUpload = function (selector, callback) { /// 图片上传 /// 文件域选择器 /// 上传成功后的回调函数 var value = $(selector).val(); if (value == ""...
分类:Web程序   时间:2015-07-20 16:15:31    阅读次数:122
jQuery如何获取选中单选按钮radio的值
jQuery如何获取选中单选按钮radio的值:下面介绍一下如何获取选中的单选按钮的值,代码非常简单。代码如下:var theradioValue=$('input:radio[name="theradio"]:checked').val();以上代码可以获取被选中的name属性值为theradio...
分类:Web程序   时间:2015-07-20 16:00:28    阅读次数:331
AndroidJNI.SetObjectField 设置对象域
static function SetObjectField (obj : IntPtr, fieldID : IntPtr, val : IntPtr) : voidDescription描述This function sets the value of an instance (nonstati...
分类:移动开发   时间:2015-07-20 15:46:29    阅读次数:118
LeeCode-Remove Linked List Elements
Remove all elements from a linked list of integers that have valueval.ExampleGiven:1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6,val= 6Return:1 --> 2 --> 3 --...
分类:其他好文   时间:2015-07-20 10:47:55    阅读次数:111
两个链表交集
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; *...
分类:其他好文   时间:2015-07-20 10:47:09    阅读次数:185
LeeCode-Insertion Sort List
Sort a linked list using insertion sort. 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * struct ListNo...
分类:其他好文   时间:2015-07-20 10:33:09    阅读次数:120
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!