摘要: 1. 问题描述给定排的数组A,大小为n,现给定数X,判断A中是否存在两数之和等于X。给出一个O(nlg(n))的算法。2. 解决思路首先对数组进行排序,如果使用归并的排序的话,算法的复杂度在nlg(n)级别,然后通过从中间相两边查找即可。3. 实现代码///<summary>///在给定的数组查找是否存在和为sum的两个元素,如果存在///函数返回true,否则false///</summary>///<paramname="arr"></param>///<paramname="sum">&l 阅读全文
posted @ 2011-03-13 20:46 qiang.xu 阅读(2530) 评论(3) 推荐(0) 编辑
摘要: usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;namespaceMergeSort{classProgram{staticvoidMain(string[]args){int[]arr=newint[]{1,8,3,5};MergeSort(refarr,0,arr.Length-1);foreach(intiteminarr){Console.WriteLine(item);}Console.ReadKey();}///<summary>///归并排序///</su 阅读全文
posted @ 2011-03-13 20:13 qiang.xu 阅读(266) 评论(0) 推荐(0) 编辑
摘要: 1.Application Platform Overview for Windows Phone2.Installing Windows Phone Developer Tools3.Create First Application for Windows Phone 7 阅读全文
posted @ 2011-03-13 19:35 qiang.xu 阅读(352) 评论(0) 推荐(0) 编辑
摘要: 1 Hello Phone Silverlight2. 代码下载1. Hello Phone Silverlight1.1 新建wp7工程,如下。1.2 vs将会生成项目模板,如下。其中SplashScreenImage.jpg是改程序加载时使用的图片,如下图所示。ApplicationIcon.png是程序显示图标。如果熟悉silverlight的话,App.xaml和MainPage.xaml应该是比较熟悉的。值得注意的是WMAppManifest.xml,该文件是对整个wp7应用程序的配置,该文件内容如下,通过英文的名字很容易知道其中代码的含义。<?xmlversion=" 阅读全文
posted @ 2011-03-13 19:28 qiang.xu 阅读(308) 评论(0) 推荐(0) 编辑
摘要: 1. 开发环境建立2. 网上资源1. 开发环境建立1.1. 安装vs20101.2. 下载安装Windows Phone Developer Tools安装完成之后,wp7的开发环境即以简历完成。2. 网上资源wp7官网:http://www.microsoft.com/windowsphone/en-gb/default.aspxmsdn开发文档:http://msdn.microsoft.com/en-us/library/ff402535(v=VS.92).aspxWindows Phone development quickstarts:http://create.msdn.com/e 阅读全文
posted @ 2011-03-13 18:43 qiang.xu 阅读(291) 评论(0) 推荐(0) 编辑
摘要: 1.OverviewWindowsPhone Application Platform提供了两种开发方式:Silverlight和Xna framework。wp7的界面(模拟器)很简洁:下面包含三个按键,分别是:Back,Start,Search按键。Back类似于浏览器上的按钮。点击Start按钮 ,将进入phone开机界面。search按钮将进入phone内置的搜索功能。wp7提供了对Wi-Fi,Camera,Accelerometer(重力感应),Location,Vibration,FM Radio,Push Notification等功能的支持。2.Architecture3.Th 阅读全文
posted @ 2011-03-13 18:32 qiang.xu 阅读(301) 评论(0) 推荐(1) 编辑
摘要: 1.How Internet Explorer was born?微软公司在1995年退出了自己的第一款浏览器,命名叫“Internet Explorer” ,但实际上这款浏览器是SpyGlass公司研发生产的,194年SpyGlass公司将研发的浏览器source授权给ms公司,于是有了95年的ie的第一个版本。看看这款浏览器吧,今天看上去是如此ugly,无法想象当时的人们对此居然津津乐道。2.Internet Explorer 2ie2是第一款跨平台的浏览器,能够同时支持windows和macos。3.Internet Explorer 34.Internet Explorer 4(Win 阅读全文
posted @ 2011-03-13 17:47 qiang.xu 阅读(376) 评论(0) 推荐(0) 编辑