码迷,mamicode.com
首页 >  
搜索关键字:crazy search    ( 12644个结果
JS中location.search什么意思
JS中location.search什么意思设置或获取 网页地址跟在问号后面的部分当以get方式在url中传递了请求参数时,可以利用location的search属性提取参数的值,下面的代码把参数的名称和对应的值存储在2个数组中。-----------------------------------...
分类:Web程序   时间:2014-05-08 20:55:13    阅读次数:657
去掉IE下input的叉号
IE10下的Input Text和谷歌下面的 input search 一旦输入内容,会在最右端出现一个叉号,点击后,内容就会自动清空,看似方便,其实有些场景并不需要,需要写代码清除掉。代码如下:input::-webkit-search-cancel-button{display: none;} ...
分类:其他好文   时间:2014-05-08 20:15:33    阅读次数:644
LeetCode OJ - Validate Binary Search Tree
验证二叉树是否是查找树,可以通过查看它的中序遍历是否是升序的。下面是AC代码: 1 /** 2 * Given a binary tree, determine if it is a valid binary search tree (BST). 3 * solution : 4...
分类:其他好文   时间:2014-05-07 09:01:45    阅读次数:250
eclipse中查看某个方法(函数)被谁调用
用了好久一直不知道eclipse中如何实现vs中查找所有引用的功能,今天终于发现了哈哈 选中要查找的方法名,右键->References->Workspace 可以定位到具体的调用位置,快捷键Ctrl+Shift+G,在Search中就会出现调用方法 或者是 右键->References->Project/Hierarchy,Workspace搜索的范围>Project>Hierarchy。...
分类:系统相关   时间:2014-05-07 05:35:52    阅读次数:372
LeetCode合集
一 线性表 1.1  数组 1.1.1 Remove Duplicates from Sorted Array 1.1.2 Remove Duplicates from Sorted Array II 1.1.3 Search in Rotated Sorted Array 1.1.4 Search in Rotated Sorted Array II 1.1.5 Median of...
分类:其他好文   时间:2014-05-07 04:24:26    阅读次数:363
FZOJ 1157 Crazy Tea Party
OJ题目:click here~~ 题目分析:1……n按顺序围成一个圈,1与n相邻。交换相邻两个数算1步。至少需要多少步,得到一个逆方向的1……n的圈。 分两半,使用冒泡排序,排成逆序的交换次数之和即为结果。 AC_CODE int f(int n){ return n*(n - 1)/2; } int main(){ int n , t; cin >> t; ...
分类:其他好文   时间:2014-05-06 23:15:55    阅读次数:301
Leetcode:Search in Rotated Sorted Array
Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). You are given a target value to search. If found in the array retur...
分类:其他好文   时间:2014-05-06 19:03:11    阅读次数:365
LeetCode OJ - Recover Binary Search Tree
这道题要求空间复杂度为O(1),则只能采用Morris Traversal进行中序遍历!!这个了解了之后,难点在于如何定位到两个被交换了的节点?我就被困在这里几个小时!!!(允许我为自己的愚蠢表示下悲伤吧!!!)参考了discuss中前辈的算法,才发现很简单!!!我们只需要这样来看问题,BST的中序...
分类:其他好文   时间:2014-05-06 12:55:19    阅读次数:301
设置UIButton的文字显示位置、字体的大小、字体的颜色、加粗
btn.frame = CGRectMake(x, y, width, height);[btn setTitle: @"search" forState: UIControlStateNormal];//设置按钮上的自体的大小//[btn setFont: [UIFont systemFontSi...
分类:其他好文   时间:2014-05-06 10:51:54    阅读次数:340
LeetCode OJ - Convert Sorted Array/List to Binary Search Tree
Array和List的区别在于前者可以随机访问,而后者只能顺序访问。对于把排好序的array转成BST,可以用top-down的方式,很直观也很自然,时间复杂度是O(n)。而对于List如果采用同样的方式,每次需要顺序遍历到中间节点,时间复杂度变成O(nlogn),如果换一种思路,down-top,...
分类:其他好文   时间:2014-05-05 09:34:29    阅读次数:454
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!