摘要:
Depth-first search:访问顺序: A, B, D, F, E, C, G.PseudocodeInput: A graph G and a vertex v of GOutput: A labeling of the edges in the connected component of v as discovery edges and back edges1 procedure DFS(G,v):2 label v as explored3 for all edges e in G.adjacentEdges(v) do4 if edg... 阅读全文
摘要:
javapublic class Hello{ public static int binarySearch(int[] a, int key) { int lo=0, hi = a.length-1; while(lo <= hi) { int mid = lo + (hi - lo) / 2; if(key < a[mid]) hi = mid-1; else if(key > a[mid]) lo = mid+1; else return mid; } return -1; } public static vo... 阅读全文
摘要:
唯一不可能错过你一直都在 阅读全文
摘要:
出处:http://www.dewen.org/q/620#include <stdio.h>int judge(int num){ int min = 1; if(num < 0) { return 0; } else if(num == 0 || num == 1) { return 1; } else { int current = 2; while(1) { if(current * current < num) { min = current; current = min * 2; } ... 阅读全文
摘要:
出处: http://www.cnblogs.com/pkuoliver/archive/2010/10/27/Convert-m-number-to-n-number.htmlC语言版:#include <stdio.h>void m2n(int m, char* mNum, int n, char* nNum){ int i=0; char c, *p = nNum; while(*mNum!='\0') i = i*m + *mNum++ - '0'; while(i) { *p++ = i%n + '0'; i /= n; } 阅读全文
摘要:
public class Hello{ private static void quickSort(int data[], int low, int hight) { int i=low,j=hight; int mid=data[(low+hight)/2]; while(i <= j) { while(data[i]<mid) i++; while(data[j]>mid) j--; if(i<=j) { int temp = data[i]; data[i] = data[j]; data[j] = t... 阅读全文
摘要:
package com.temp;import java.util.ArrayList;public class PolymorphismTest{ /** * @param args */ public static void main(String[] args) { ArrayList<Human> persons = new ArrayList<Human>(); persons.add(new Male()); persons.add(new Female()); ... 阅读全文
摘要:
public Icon LoadIconFromExtension(string extension) { string path = string.Format("dummy{0}", extension); using (File.Create(path)) { } Icon icon = Icon.ExtractAssociatedIcon(path); File.Delete(path); return icon; }关键是创建了临时文件 阅读全文
摘要:
2011-2012:用delphi开发了Dota的改建工具,挤房器,锐捷自动连接辅助工具2013:熟练使用主流技术, Java、Linux、C等, 尝试建立自己的开源项目 阅读全文
摘要:
参考: http://blog.csdn.net/freeboy1015/article/details/6873938注: MainForm.cs 对应有 MainForm.resx(各语言有不同的标记)主要步骤:1. 创建不同语言的.resx文件, 设置其 名称-值 的内容2. 设置线程的CultureInfo, 并重新绑定主要代码:Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("zh-Hans");UpDataMainFormUILanguage(); publ 阅读全文