This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* ===================================================================================== | |
* | |
* Filename: sys_usage.c | |
* | |
* Description: get usage of CPU and I/O | |
* | |
* Version: 1.0 | |
* Created: 04/09/2012 02:23:08 PM | |
* Revision: none |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* CareerCup 150 4/16-4/22 1.1 | |
* | |
* slaink@1point3acres | |
* | |
*/ | |
/* | |
* 首先想到的是排序,如果可以用其他数据结构的话,我倾向于使用一个二叉树,遇到重复节点时候,计算结束。 | |
* 既然不能使用其他数据结构,那么还是使用排序呗。剩下的就是算法复杂度的问题了。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Reference | |
* [1] http://programminggeeks.com/c-code-for-quick-sort/ | |
* | |
* just add some comments, ALL CODES WAS DONE BY reference[1]. | |
* If that's not cool, just tell me and I'll delete this. | |
*/ | |
#include "stdio.h" | |
int split ( int*, int, int ) ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* CareerCup 150 4/16-4/22 1.2 | |
* | |
* slaink@1point3acres | |
* | |
*/ | |
/* | |
* 反转字符串的话最容易的就是从两端(用i,j)开始swap,最后到i,j重合或者i>j. | |
* 这样会有一个问题就是strlen是怎么算出来的?如果是遍历寻找\0的话,那么这就有了一个n了. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* CareerCup 150 4/16-4/22 1.3 | |
* | |
* slaink@1point3acres | |
* | |
*/ | |
/* | |
*感觉上和1.1类似,但是不需用任何其他的buffer,只能一两个变量。这样说来bitmap就肯定不行了。 | |
*再考虑一下qsort的可能性,qsort的确可以nlogn时间找到dup,但是另一个问题是如何删除字符串。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* CareerCup 150 4/16-4/22 1.4 | |
* | |
* slaink@1point3acres | |
* | |
*/ | |
/* | |
* 两个字符串是回文的话,应该是类似abcde edcba 这样子吧? | |
* 如果真的如此,那么直接从字符串a开头开始于字符串b结尾开始比较,如果遇到不相同则输出 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* CareerCup 150 4/16-4/22 1.5 | |
* | |
* slaink@1point3acres | |
* | |
*/ | |
/* | |
* 简单来说,就是一个字符替换成三个字符的问题 | |
* 从后往前遍历,如果找到了空格,空格后的字符串向右移动两个char,然后修改。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* CareerCup 150 4/16-4/22 1.1 | |
* | |
* slaink@1point3acres | |
* | |
*/ | |
/* | |
* 主要想到的就是遍历,不过加上几个flag,防止多次置零,同时当某行某列已经置零之后,跳过循环 | |
* M*N 是m行n列吧…… |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.BorderLayout; | |
import java.awt.FlowLayout; | |
import java.awt.Panel; | |
import java.awt.event.ActionEvent; | |
import java.awt.event.ActionListener; | |
import java.util.ArrayList; | |
import java.util.List; | |
import javax.swing.JButton; | |
import javax.swing.JFrame; | |
import javax.swing.JPanel; |
OlderNewer