HTML代码分享

.NET

C#分别用前序遍历、中序遍历和后序遍历打印二叉树

74 0

C#分别用前序遍历、中序遍历和后序遍历打印二叉树123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172public class BinaryTreeNode{ public BinaryTreeNode Left { get; set; } public BinaryTree

.NET

二叉搜索树插入算法C#

25 0

12345678910111213141516171819202122232425262728293031323334353637383940public class BinaryTreeNode{ public BinaryTreeNode Left { get; set; } public BinaryTreeNode Right { get; set; } public int Data { get; set; } public BinaryTreeNode

.NET

C#读取中文文件乱码的解方法

289 0

123456FileStream aFile = new FileStream(SingleFile, FileMode.Open);StreamReader sr = new StreamReader(aFile, Encoding.GetEncoding("gb2312"), true);string FileContent = sr.ReadToEnd();aFile.Close();ProcessData Pd = new ProcessData();Pd.ProceData(FileConten

.NET

C#自定读取配置文件类

101 0

这个C#类定义了读取AppSettings的配置文件的常用方法,通过这个类可以很容易从AppSettings配置文件读取字符串、数字、bool类型的字段信息。登录,注册,订阅,RSS,网站地图123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384

.NET

C# 四舍五入round函数使用

45 0

C#中的round函数实际上不是真正的四舍五入函数,一般的程序设计语言的round函数也都不是四舍五入函数,而是银行家舍入法函数,也就是“四舍六入五考虑,五后非零就进一,五后为零看奇偶,五前为偶应舍去,五前为奇要进一”1234567891011121314151617181920using System; public class Example{ public static void Main() { double[] values = { 2.125, 2.135, 2.145,

.NET

C#测试代码执行时间的方法

315 0

12345678Stopwatch sw = new Stopwatch(); sw.Start(); //这里填写要执行的代码 sw.Stop(); Console.WriteLine("总运行时间:" + sw.Elapsed); Console.WriteLine("测量实例得出的总运行时间(毫秒为单位):" + sw.ElapsedMilliseconds); Console.WriteLine("总运行时间(计时器刻度标识):" + sw.ElapsedTicks); Consol

.NET

常用的C#类

25 0

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113using System; using Sys

C/C++

C语言使用utlist实现的双向链表

53 0

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253#include <stdio.h>#include <stdlib.h>#include <string.h>#include "utlist.h" #define BUFLEN 2