2011年8月28日
摘要: 本文介绍的排序算法有:冒泡排序,选择排序,插入排序,归并排序,希尔排序,堆排序,快速排序,计数排序,基数排序,桶排序。包括定义描述、排序过程、复杂度和代码实现(如有错误,请指正 Thanks)。概念:排序稳定:如果两个数相同,对他们进行的排序结果为他们的相对顺序不变。原地排序:原地排序就是指不申请多余的空间来进行的排序,就是在原来的排序数据中比较和交换的排序。例如快速排序,堆排序等都是原地排序,合并排序,计数排序等不是原地排序。冒泡排序 [Bubble Sort] 依次比较相邻的两个数,将小数放在前面,大数放在后面。 复杂度: 最差时间复杂度[O(n^2)],最优时间复杂度[O(n)],... 阅读全文
posted @ 2011-08-28 15:19 PeterZhang 阅读(1549) 评论(4) 推荐(11) 编辑
  2011年7月26日
摘要: 1. 在Form上加notifyicon控件notifyIcon1,为控件的属性Icon添加一个icon图标, Text为鼠标在图标上时显示的tip。2. 在Form1_SizeChanged中设置Form的ShowInTaskbar属性3. 在notifyIcon1_Click事件中设置Form的ShowInTaskbar和WindowState属性4. 添加ContextMenuStrip控件ContextMenuStrip1,右键托盘图标弹出菜单,设置notifyIcon1的ContextMenuStrip属性为ContextMenuStrip1。在ContextMenuStrip1中添 阅读全文
posted @ 2011-07-26 23:05 PeterZhang 阅读(487) 评论(0) 推荐(0) 编辑
  2011年7月25日
摘要: 在OnStart和OnStop方法中添加服务启动和停止时的处理代码 protected override void OnStart(string[] args) { } protected override void OnStop() { } 还需要添加Installer才能加载服务,在Service类的设计界面 右键-> Add Installer。 在Installer类中,serviceInstaller属性:ServiceName,StartType;设置serviceProcessInstall... 阅读全文
posted @ 2011-07-25 22:58 PeterZhang 阅读(1079) 评论(0) 推荐(0) 编辑
摘要: 1 using System; 2 using System.Collections.Generic; 3 using System.Runtime.InteropServices; 4 using System.Security.Principal; 5 using System.Text; 6 7 namespace SystemUsers 8 { 9 class Program10 {11 [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]12 public struct USER_INFO_013 {14 . 阅读全文
posted @ 2011-07-25 21:59 PeterZhang 阅读(5007) 评论(0) 推荐(0) 编辑
  2011年7月20日
摘要: JSON(JavaScript Object Notation) 是一种轻量级的数据交换格式,非常适合于服务器与 JavaScript 的交互。具体形式:1. 对象是一个无序的“‘名称/值’对”集合 {属性:值,属性:值,属性:值} eg: {name:"Peter Zhang",age:21,location:"Shanghai"} 值(value)可以是双引号括起来的字符串(string)、数值(number)、true、false、 null、对象(object)或者数组(array)。这些结构可以嵌套。2. 数组是值(value)的有序集合 [ 阅读全文
posted @ 2011-07-20 22:09 PeterZhang 阅读(803) 评论(0) 推荐(0) 编辑
  2011年5月12日
摘要: .assembly extern mscorlib{ .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) .ver 2:0:0:0}.assembly CILTypes{ .ver 1:0:0:0}.module CILTypes.dll.namespace MyNamespace{ //definitions for interface .class public interface IMyInterface{} //definitions for class .class public MyBaseClass { //fields .field pri 阅读全文
posted @ 2011-05-12 21:15 PeterZhang 阅读(7304) 评论(2) 推荐(2) 编辑
  2010年7月27日
摘要: #region /// <summary> /// 全排列 递归 考虑重复 /// Peter /// </summary> public static String[] Permutation(String s) { if (s.Length == 1) { String[] res = new String[1]; res[0] = s; return res; ... 阅读全文
posted @ 2010-07-27 14:34 PeterZhang 阅读(1704) 评论(2) 推荐(0) 编辑
  2010年7月26日
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace CSDN_Testing{ #region //@Author: Peter //@Date: 7/26/2010 #endregion #region /// <summary> /// The definition of the node, and the link is composed of node. /// There are two fields in... 阅读全文
posted @ 2010-07-26 20:56 PeterZhang 阅读(1524) 评论(0) 推荐(0) 编辑
  2010年7月23日
摘要: 1、将一整数逆序后放入一数组中(要求递归实现) class Program { public List<Int32> list = new List<Int32>(); public void Reverse(Int32 i) { if (i < 10) { list.Add(i); } else { list.Add(i % 10); Rev... 阅读全文
posted @ 2010-07-23 16:06 PeterZhang 阅读(1434) 评论(2) 推荐(1) 编辑
  2010年7月21日
摘要: #region //***************************** //*** Formatting Types *** //***************************** #region //------------------------------------ //------标准及自定义数字格式字符串---- //------------------------------------ ... 阅读全文
posted @ 2010-07-21 16:14 PeterZhang 阅读(585) 评论(0) 推荐(2) 编辑