码迷,mamicode.com
首页 >  
搜索关键字:linux运维 面试 应用软件    ( 23027个结果
LeetCode: Remove Duplicates from Sorted Array II [080]
【题目】 Follow up for "Remove Duplicates": What if duplicates are allowed at most twice? For example, Given sorted array A = [1,1,1,2,2,3], Your function should return length = 5, and A is now [1,1,2,2,3]. 【题意】 给定一个有序数组,给数组去重,和Remove Duplicates from...
分类:其他好文   时间:2014-06-03 05:36:24    阅读次数:219
ubuntu下apache虚拟主机出现forbidden错误的解决办法
apache的虚拟主机一直运行都是正常,但是当我升级了ubuntu系统之后,再启动apache时,虚拟主机出现了forbidden的错误。在网上找了很长时间答案,但是很多方法试了之后都无效,最后还是找到了解决办法,先记录下来,后面防止再发生这样的错误。 奇怪现象:如果将document root指向/var/www或其子目录,那么就不会出现forbidden错误————太奇怪了~~ 失败方法:...
分类:其他好文   时间:2014-06-03 04:13:25    阅读次数:202
LeetCode: Remove Duplicates from Sorted List [082]
【题目】 Given a sorted linked list, delete all duplicates such that each element appear only once. For example, Given 1->1->2, return 1->2. Given 1->1->2->3->3, return 1->2->3. 【题意】 给定一个已排序的链表,删除其中的重复元素 【思路】 维护两个指针prev和cur, cur指针负责扫描链表,prev指向cur的前一...
分类:其他好文   时间:2014-06-03 04:05:39    阅读次数:231
LeetCode: Search in Rotated Sorted Array II [081]
【题目】 Follow up for "Search in Rotated Sorted Array": What if duplicates are allowed? Would this affect the run-time complexity? How and why? Write a function to determine if a given target is in the array. 【题意】 在“Search in Rotated Sorted Array”的基...
分类:其他好文   时间:2014-06-03 01:55:38    阅读次数:173
变量值交换
交换两个变量:例如num1=5,num2=6→num1=6,num=5 怎么样?是不是觉得灰常简单,你是不是用下面的方法做的: int num1=5; int num2=6; int temp=num1; num1=num2; num2=temp; Console.WriteLine("num1={0},num2={1}",num1,num2); 好吧!你赢了!你做的非常对!就就是...
分类:其他好文   时间:2014-06-03 01:51:43    阅读次数:225
LeetCode: Word Search [079]
【题目】 Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically neighboring. The same letter cell may not be use...
分类:其他好文   时间:2014-06-03 01:07:58    阅读次数:329
LeetCode: Partition List [086]
【题目】 Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the original relative order of the nodes in each of the two partitions. For example, Given 1->4->3-...
分类:其他好文   时间:2014-06-03 00:02:29    阅读次数:270
LeetCode: Maximal Rectangle [085]
【题目】 Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area. 【题意】 给定一个由0和1填充的二维矩阵,找一个全是1的最大矩形 【思路】 扫描二维矩阵,凡是扫到值为1的块时候,以当前块为矩形的左上角区块拓展,找最大矩阵。 先找出以每个“1”区块为左上角区块的最大矩形,然后求出最大全局的最大矩...
分类:其他好文   时间:2014-06-02 23:08:07    阅读次数:289
【leetcode】 Longest Substring Without Repeating Characters
题目: 给定一个字符串,返回该串没有重复字符的最长子串。 分析: 1)子串:子串要求是连续的。 2)无重复,出现重复就断了,必须从新的位置开始。而新的位置就是重复字符第一次出现位置的下一个位置。 3)整个串可能没有一处重复。 那么,为了找出当前访问的字符是否出现过,要怎么做呢?当然是hash,O(1)的时间,而且既然是字符, 定义个255的hash table 就可以了,has...
分类:其他好文   时间:2014-06-01 10:48:31    阅读次数:206
C++ 实践总结
??对于一个应用程序而言,静态链接库可能被载入多次,而动态链接库仅仅会被载入一次。Gameloft面试之错误一Event:面试官说例如以下程序是能够链接通过的.class Base{Public:Base(void){this-> initialize();}virtual void initial...
分类:编程语言   时间:2014-05-31 20:07:51    阅读次数:400
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!