为锐捷配置网络ip,以及DNS1.配置IP网关:sudo gedit /etc/network/interfaces静态IP修改配置文件如下改成自己的参数():auto loiface lo inet loopbackauto eth0iface eth0 inet static#pre-up if...
分类:
其他好文 时间:
2014-08-23 17:36:31
阅读次数:
419
使用root用户在/etc/init.d中touch tomcat文件,使用VI编辑脚本内容如下:#!/bin/bash## tomcat ## chkconfig:345 71 71 # description: Start up the Tomcat servlet engine...
分类:
系统相关 时间:
2014-08-23 16:46:41
阅读次数:
307
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 r...
分类:
其他好文 时间:
2014-08-23 11:18:00
阅读次数:
167
setTimeout, 单位是毫秒setTimeout ( time code, timer delay );eg:setTimeout("alert('wake up!')", 100000);The document object表示网页代码本身修改用户窗口(不是整个浏览器)的大小,可以用bod...
分类:
编程语言 时间:
2014-08-23 08:46:10
阅读次数:
200
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 ...
分类:
其他好文 时间:
2014-08-23 02:15:59
阅读次数:
157
```python def is_pamax(name): low = 0 up = len(name)-1 while low < up: if name[low] != name[up]: return False low += 1 up -= 1 return True f = open("D:/names.txt") max_length = 0 for line in f: nam...
分类:
其他好文 时间:
2014-08-23 01:12:09
阅读次数:
383
实现一个栈,除了push和pop操作,还要实现min函数以返回栈中的最小值。
push,pop和min函数的时间复杂度都为O(1)。
看到这个题目最直接的反应是用一个变量来保存当前栈的最小值,让我们来看看这样可行否?
如果栈一直push那是没有问题,入栈元素如果比当前最小值还小,那就更新当前最小值。
可是如果pop掉的栈顶元素就是最小值,那么我们如何更新最小值呢?显然不太好办。...
分类:
其他好文 时间:
2014-08-22 22:38:01
阅读次数:
176
LeetCode: Linked List CycleGiven a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space?地址:https://oj....
分类:
其他好文 时间:
2014-08-22 22:28:09
阅读次数:
285
给定一个循环链表,实现一个算法返回这个环的开始结点。
定义:
循环链表:链表中一个结点的指针指向先前已经出现的结点,导致链表中出现环。
例子:
输入:A -> B -> C -> D -> E -> C [结点C在之前已经出现过]
输出:结点C
可以用一个map 就解决问题了。
下面是编程之美上一种奇特的解法:快慢指针解法。
代码:...
分类:
其他好文 时间:
2014-08-22 21:16:09
阅读次数:
296
转自:http://www.opsers.org/base/clean-up-on-the-linux-system-tmp-folder-you-may-want-to-know.html§我们知道,在Linux系统中/tmp文件夹里面的文件会被清空,至于多长时间被清空,如何清空的,可能大家知识的...
分类:
其他好文 时间:
2014-08-22 16:15:39
阅读次数:
194