码迷,mamicode.com
首页 >  
搜索关键字:end    ( 30778个结果
最优雅的二分查找
今天复习以前的代码,突然发现插入排序用的二分查找算法实现得很别扭,于是试试重写一个,没想到相当顺利,几分钟就写好并测试通过了:static int BinarySearch(int[] array, int value, int start, int end) { if(start ==...
分类:其他好文   时间:2015-03-21 18:32:27    阅读次数:99
LeetCode - Refresh - Pascal's Triangle
This is simple. Just everything use current[j] += current[j-1]. But leave the first one to be "1". Then add another "1" to end. 1 class Solution { 2 p...
分类:其他好文   时间:2015-03-21 18:28:23    阅读次数:98
LeetCode – Refresh – Palindrome Partitioning I
1 class Solution { 2 public: 3 bool isP(string s) { 4 int start = 0, end = s.size()-1; 5 while (start > &result, vector current,...
分类:其他好文   时间:2015-03-21 17:02:38    阅读次数:116
LeetCode – Refresh – One Edit Distance
Scanning from start to end. If find a mismatch and one is larger size, keep search from the previous char of shorter one.Finally check whether found a...
分类:其他好文   时间:2015-03-21 16:56:01    阅读次数:142
LeetCode – Refresh – Palindrome Number
1. x/rec >= 10.2. find start and end of a number. 1 class Solution { 2 public: 3 bool isPalindrome(int x) { 4 if (x = 10) rec *= 10; 7 ...
分类:其他好文   时间:2015-03-21 16:54:58    阅读次数:122
Leetcode: Remove Nth Node From End of List
题目: Given a linked list, remove the nth node from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2.After removing the second node from the end, the linked...
分类:其他好文   时间:2015-03-21 12:41:53    阅读次数:115
微软职位内部推荐-Senior Software Engineer - Front End
微软近期Open的职位:SharePoint is a multi-billion dollar enterprise business that has grown from an on-premises product that IT admins love into a core part o...
分类:其他好文   时间:2015-03-21 12:34:31    阅读次数:141
std 迭代器的几种用法
转自 :http://blog.csdn.net/kjing/article/details/6936325C++ primer (中文版第四版)第273页9.3.2 begin和end成员 begin和end操作产生指向容器内第一个元素和最后一个元素的下一个位置的迭代器,如下所示。这两个迭代器通常...
分类:其他好文   时间:2015-03-21 11:13:08    阅读次数:167
vim操作
1.以word为单位的移动 w,e;b,ge(word,end,back)2.移动到行首或行尾 ^,$3.移动到指定的字符上 f;F(find) t;T(to) 用“;”来重复命令。用“,”来重复命令,但是方向与原来的命令相反。4.匹配一个括号为目的的移动 %5.移动到指定行( 全部文本为对象) G...
分类:系统相关   时间:2015-03-21 11:02:09    阅读次数:142
LeetCode – Refresh – Next Permutation
1 class Solution { 2 public: 3 void swap(int &a, int &b){int t = a; a = b; b = t;}; 4 void reverse(vector &num, int start, int end) { 5 ...
分类:其他好文   时间:2015-03-21 11:00:51    阅读次数:98
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!