阅读下列函数说明和C代码,回答下面问题。[说明] 冒泡排序算法的基本思想是:对于无序序列(假设扫描方向为从前向后,进行升序排列),两两比较相邻数据,若反序则交换,直到没有反序为止。一般情况下,整个冒泡排序需要进行众(1≤k≤n)趟冒泡操作,冒泡排序的结束条件是在某一趟排序过程中没有进行数据交换。若数据初态为正序时,只需1趟扫描,而数据初态为反序时,需进行n-1趟扫描。在冒泡排序中,一趟扫描有可能无数据交换,也有可能有一次或多次数据交换,在传统的冒泡排序算法及近年的一些改进的算法中[2,3],只记录一趟扫描有无数据交换的信息,对数据交换发生的位置信息则不予处理。为了充分利用这一信息,可以在一趟全局扫描中,对每一反序数据对进行局部冒泡排序处理,称之为局部冒泡排序。 局部冒泡排序的基本思想是:对于N个待排序数据组成的序列,在一趟从前向后扫描待排数据序列时,两两比较相邻数据,若反序则对后一个数据作一趟前向的局部冒泡排序,即用冒泡的排序方法把反序对的后一个数据向前排到适合的位置。扫描第—对数据对,若反序,对第2个数据向前冒泡,使前两个数据成为,有序序列;扫描第二对数据对,若反序,对第3个数据向前冒泡,使得前3个数据变成有序序列;……;扫描第i对数据对时,其前i个数据已成有序序列,若第i对数据对反序,则对第i+1个数据向前冒泡,使前i+1个数据成有序序列;……;依次类推,直至处理完第n-1对数据对。当扫描完第n-1对数据对后,N个待排序数据已成了有序序列,此时排序算法结束。该算法只对待排序列作局部的冒泡处理,局部冒泡算法的名称由此得来。 以下为C语言设计的实现局部冒泡排序策略的算法,根据说明及算法代码回答问题1和问题2。 [变量说明] #define N=100 //排序的数据量 typedef struct{ //排序结点 int key; info datatype; ...... }node; node SortData[N]; //待排序的数据组 node类型为待排序的记录(或称结点)。数组SortData[]为待排序记录的全体称为一个文件。key是作为排序依据的字段,称为排序码。datatype是与具体问题有关的数据类型。下面是用C语言实现的排序函数,参数R[]为待排序数组,n是待排序数组的维数,Finish为完成标志。 [算法代码] void Part-BubbleSort (node R[], int n) { int=0 ; //定义向前局部冒泡排序的循环变量 //暂时结点,存放交换数据 node tempnode; for (int i=0;i<n-1;i++) ; if (R[i].key>R[i+1].key) { (1) while ( (2) ) { tempnode=R[j] ; (3) R[j-1]=tempnode ; Finish=false ; (4) } // end while } // end if } // end for} // end function 问题2请根据算法的C代码,分析此算法效率。
The third round of campaign to solicit(征集) songs for the Beijing 2008 Olympic Games is to be launched on New Year’s Day. The solicitation campaign of songs for the Volunteers of Beijing 2008 will simultaneously be launched. Online music pieces will be eligible for the campaigns for the first time. Rules and regulations of’ the campaigns will be available at www. beijing2008, cn (the official Web site of BOCOG), www.sohu.com as well as newspapers. The campaigns will last till 17:00, June 1, 2006. BOCOG will organize a consulting panel(顾问团队) consisting of foreign and domestic music producers, and will make full use of production capabilities and platforms of Chinese Musician Association, international record corporations and TV stations to boost(推进) every phase of the campaigns. What will Chinese Musician Association, international record corporations and TV stations do in the campaign They will ______ of the campaigns.
Against the backdrop of the Montreal Summit on global climate being held this week, an article on Mrican droughts and monsoons, by a University of California, Santa Barbara scientist and others, which appears in the December issue of the journal Geology, underlines concern about the effects of global climate change. Tropical ocean temperatures and land vegetation have an important effect on African monsoon systems, explains first author Syee Weldeab, a post-doctoral fellow in the Department of Earth Science at the University of California, Santa Barbara. The monsoons are critical to sustaining agriculture in equatorial Mrica. Weldeab says that man’s reduction of inland vegetation cover through deforestation and overgrazing in equatorial Africa and increases in global temperatures through the emission of greenhouse gases will likely strongly affect the African monsoon system in the future. "The weakening of the monsoon has a huge effect," says Wetdeab, "resulting in shortages of harvests and hunger." As vegetation is cleared, the land loses its capacity to retain heat and becomes cooler. As the land cools relative to the ocean, there is a larger gradient between the ocean temperature and the land causing less moisture to be pulled from the ocean air toward the land. Weldeab and his colleagues studied cores from beneath the ocean floor of the Gulf of Guinea, in the tropical Atlantic just off the coast of Cameroon, to understand the history of climate in the area for the past 10,000 years. The cores contain foraminifera, tiny plankton shells that are composed of calcium and trace elements. By studying the ratios of magnesium and calcium in the shells, the. scientists are able to correlate that information to past temperature changes in the ocean. In analyzing these records for the past 10,000 years, the scientists found three pronounced cooling periods which indicate drought. Besides the ocean records, the scientists analyzed data from four lakes that are distributed across central Africa on the monsoon belt. The three sea surface cooling periods found by the scientists correlate to records of low lake levels. These clearly were times of drought; the land became more arid. The authors state, "periods of drought likely brought about environmental hardship, triggering population migration, giving rise to changes in the modes of agricultural production, and influencing the fall or rise of civilizations." Weldeab points out that the past 50 years are marked by deforestation and overgrazing much greater than that of the past, thus disturbing the climate system that results from the coupling of sea surface temperature and vegetation cover on land. "We can’t predict how, but it is clear that this human-induced change will change the terrestrial and ocean system," he says. He notes that droughts in this region are currently occurring more frequently than in the past few thousand years, although the frequency of the droughts is unpredictable. "People in less developed countries live from rain, harvests and animal husbandry," says Weldeab. "Drought directly affects them; they run out of food for people and animals.\ The monsoon system in Africa is influenced by any of the following EXCEPT ______.
A. droughts
B. deforestation
C. overgrazing
D. global warming