前些时候做过的一份面试试题[2]

[入库:2005年8月18日] [更新:2007年3月25日]

本文简介:选择自 keminlau 的 blog

题目一:

1.  编写冒泡排序程序

要求:

1)  请用c#编写一个冒泡排序的程序,

2)  要求排序的数据从文件c:\data.dat中读取,数据间用逗号分隔。

解:

using system;

using system.io;

class test{

         static void bubblesort(int[] ai) {

                   for (int j = ai.length - 1; j > 0; j--){ // outer loop (backward)

                            for (int i = 0; i < j; i++) // inner loop (forward)

本文关键:前些时候做过的一份面试试题
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top