摘要:
日常测试中,比如某个模块的测试,我们可以对它进行下列分类测试举例,比如网站的登录模块1. 功能测试 有效测试用例,无效的测试用例;空格,空格等等2. 集成测试 和其它模块的结合测试,比如在某个页面,点击输入相关信息,点击登录后,是否进入相应页面,或者进入用户中心。3. 性能测试 登录模块在几百,几千... 阅读全文
摘要:
最好的办法是用hashtable, 时间复杂度最坏a.lengh+b.lengh最差的用两个for. 时间复杂度 a*b//求两个数组的交集给你两个排序的数组,求两个数组的交集。//比如: A = 1 3 4 5 7, B = 2 3 5 8 9, 那么交集就是 3 5./*本文方法:因为数组A B... 阅读全文
摘要:
栈,先进后出,像桶一样,先放进去,最后才出来。队列,先进先出,就像管道一样,自来水管道,先进先出View Code using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Collections;namespace StackTest{ class Program { static void Main(string[] args) { int[] iArrary = new int[] { 1, 13... 阅读全文
摘要:
需要用到ArrayList 和 StringBuilder static void Main(string[] args) { string str = "ABCDEFABCD"; string test = DeleteCom... 阅读全文
摘要:
其实主要用到Array.Sort(), ArrayList, List就可以对字符串数组或者int数组进行操作View Code using System;using System.Collections;using System.Collections.Generic;namespace InsertionSorter{ public class InsertionSorter { //List 可以直接操作,直接ToArray数组 public static string[] GetString(string[] values) { ... 阅读全文
摘要:
字符串里面的单词反转,可以用string/stringBuilderView Code using System;using System.Collections;using System.Text;namespace InsertionSorter{ public static class InsertionSorter { public static string ReverseString(string str) { string result = null; string[] s = str.Split... 阅读全文
摘要:
.NET 平台在内存管理方面提供了 GC(Garbage Collection),负责自动释放托管资源和内存回收的工作。但在以下两种情况需要我们手工进行资源释放:一、由于它无法对非托管资源进行释放,所以我们必须自己提供方法来释放对象内分配的非托管资源,比如你在对象的实现代码中使用了一个 COM 对象;二、你的类在运行是会产生大量实例,必须自己手工释放这些资源以提高程序的运行效率。最理想的办法是通过实现一个接口显式的提供给客户调用端手工释放对象,System 命名空间内有一个 IDisposable 接口,拿来做这事非常合适。View Code View Code using System;na 阅读全文