noj大作业

合集下载

第三次大作业(5)

第三次大作业(5)

第三次⼤作业(5)学⽣班级___________学⽣姓名___________批阅⽇期___________批阅教师___________英语I(2) 第三次作业第⼆部分词汇与结构(共计40分,每⼩题2分)6-25题:阅读下⾯的句⼦,从A,B,C 三个选项中选出⼀个能填⼊空⽩处的最佳选项,并在答题纸上写出所选的字母符号. .6 He learned how to use sign language to ________ with deaf customers.A. connectB. contactC. communicateD. relate7. Peter may ________ with this,but I dont really care.A. disagreeB. failC. differD. discourage8. I told them I was perfectly ________ to help if they asked.A. kindB. interestedC. willingD. favorable9. Its a simple dish to prepare,________ mainly of rice and vegetables.A. making upB. composingC. containingD. consisting10. The samples ________ in quality but were generally acceptable.A. variedB. changedC. disagreedD. exchanged11. It was dark so I didnt notice what ________ of the office for a few days while he was away.A. setB. sampleC. typeD. pattern12. The boss asked her to take ________ of the office for a few days while he was away.A. taskB. dutyC. workD. charge13. Dont give me so much information-youre ________ me!A. mistakingB. mixingC. misunderstandingD. confusing14. How does she manage to keep her ________ when she eats so much?A. bodyB. figureC. stateD. outline15. Theyve already been given a 10% raise so why are they ________?A. disapprovingB. dissatisfyingC. complainingD. proposing答案:6. C 7. A 8. C 9. D 10. A11. C12. D 13. D 14. B 15. C16. Im afraid your son has been ________ in an accident.A. fallenB. involvedC. succeededD. dropped17. The great amount of rain this autumn had ________ the harvest of cotton.A. impressedB. effectedC. dismissedD. affected18. Local train and bus times are ________ on the notice board.A. displayedB. expressedC. made upD. moted down19. I think these traditional customs should be ________ .A. stayedB. remainedC. reservedD. preserved20. If you want to know how a word is used,________ the word up in the dictionary.A. referB. lookC. seekD. see21. My opinions on this matter are similar to ________.A. theirsB. theyC. themD. their22. Shes busy ________ out the wedding invitations.A. writesB. to writeC. writeD. writing23. They are quarrelling about the property their father ________ when he died.A. leftB. had leftC. was leavingD. would left24. She lives on a farm,so she ________ up early.A. is used to getB. used to getC. is used to gettingD. used to getting25. If I couldnt get a scholarship,I ________ a job instead of going to graduate school next fall.A. will getB. might getC. would have gotD. might have got答案:16. B 17. D 18. A 19. D 20. B21. A 22. D 23. B 24. C 25. B第三部分阅读理解(共计20分)26-30题:阅读下列短⽂,从A,B,C三个选项中选出⼀个正确答案,并在答题纸上写出所选的字母符号.(共计10分,每⼩题2分)31-35 题: :阅读下列短⽂,从A,B,C三个选项中选出⼀个正确答案,并在答题纸上写出所选的字母符号.(共计10分,每⼩题2分) Passage 1Holidaymakers who are bored with baking beaches and overheated hotel rooms head for a big igloo. Swedish businessman Nile Bergqvist is delighted with his new hotel, the world’s first igloo hotel. Built in a small town in Lapl and, it has been attracting lots of visitors, but soon the fun will be over.In two weeks?time Bergqvist’s ice creation(作品) will be nothing more tha n a pool of water. “We don’t see it as a big problem,” he says. “We just loo k forward to replacing it.”Bergqvist built his first igloo in 1991 for an art exhibition. It was so suc cessful that he designed the present one, which measures roughly 200 square meters. Six workmen spent more than eight weeks piling 1,000 tons of snow o nto a wooden base; when the snow froze, the base was removed. “The only w ooden thing we have left in the igloo is the front door,” he says.After their stay, all visitors receive a survival certificate recording their su ccess. With no windows, nowhere to hang clothes and temperatures below 0℃, it may seem more like a survival test than a relaxing(轻松的) hotel break. “I t’s great fun,”Bergqvist explains, “As well as a good start in survival trainin g.”The popularity of the igloo is beyond doubt: it is now attracting tourists f rom all over the world. At least 800 people have stayed at the igloo this seas on even though there are only 10 rooms. “You can get a lot of people in,” ex plains Bergqvist.“The beds are three meters wide by two meters long, and ca n fit at least four at one time.”26.Bergqvist designed and built the world’s first igloo hotel because ____ ____.A. he believed people would enjoy trying something newB. he wanted to make a name for the small townC. an art exhibition was about to openD. more hotel rooms were needed27.When the writer says “the fun will be over,” he refers to the fact tha t ________.A. hotel guests will be frightened at thought of the hard testB. Bergqvist’s hotel will soon become a pool of waterC. holidaymakers will soon get tired of the big iglooD. a bigger igloo will replace the present one28.according to the text, the first thing to do in building an igloo is ___ _____.A. to gather a pool of waterB. to prepare a wooden baseC. to cover the ground with iceD. to pile a large amount of snow29.When guests leave the igloo hotel they will receive a paper stating th at ________.A. they have visited LaplandB. They have had an ice-snow holidayC. they have had great fun sleeping on iceD. they have had a taste of adventure(/doc/8118269387.html)30.Which of the four pictures below is the closest to the igloo hotel as described in the text?【答案与解析】这是⼀篇介绍度假雪屋如何应运⽽⽣的⽂章。

专业外语大作业word精品文档15页

专业外语大作业word精品文档15页

专业英语大作业专业:电子信息工程班级:学号:姓名:2011——2012(2)晶体管的工作原理晶体管的设计使它的功能相当于一个放大器或一个开关。

它的作用是实现用少量的电能去控制大量的电源供应,就像转阀控制水的供应一样。

晶体管是由三个部分组成——基极、集电极和发射极。

基极是大供电的门控制器部分,集电极是提供更大的电力的部分,,发射极供电的输出部分。

通过发送不同范围的基极电流,从而调节流经集电极的电流。

这样,就像放大器一样,一个非常小的电流就可以用来控制较大的电流。

这个过程被用来为数字处理器创建二进制代码,但需5伏特的门槛电压才能正常工作。

因此,晶体管常被用作门限开关:开关闭合;不超过5伏特时,开关断开。

半导体材料的应用使晶体管的制作成为可能。

人们习惯把材料分为导电和绝缘两种。

金属通常被认为是良导体,而木材、塑料、玻璃、陶瓷等材料通常被认为是不导电的,即绝缘体。

19世纪40年代末,一组在新泽西州的贝尔实验室工作的科学家在研究半导体的特性时,发现了如何制作某些类型的晶体,并把它们作为电子控制装置。

大多数非金属晶体都会被视为绝缘体。

但通过迫使在锗或硅晶体中掺杂硼或磷等杂质,会使晶体获得完全不同的导电性能。

通过在两个导电板(发射极和集电极) 间加入这种材料,晶体管就做好了。

利用基极电流来控制电流的流向。

约翰。

巴丁,沃尔特。

布拉顿和威廉萧克利对晶体管的发明做出了卓越的贡献,他们的专利被称为:“利用半导体材料三电极电路元件。

”现在主要有两种类型的晶体管——双极结型晶体管(BJT)和场效应晶体管。

它们以不同的方式进行工作。

但任何晶体管的用处都在于它能用较弱的电压去控制很大的电流。

例如, 在公共广播系统利用电晶体放大(即加强)人的声音经麦克风形成的弱电压,经晶体管放大后的电源已足够操作扩音器,使之产生比人声响亮的多的声音。

双极结型晶体管双极结型晶体管是在两层厚介质间填充一种稍薄的半导体材料的晶体管类型。

例如,若中间的介质为P型,那么外边的两层介质必须为N型,这样就构成了一个NPN晶体管。

北京工业大学高级软件工程大作业

北京工业大学高级软件工程大作业

物流管理系统设计设计人:张娜蔡欣洪姚茜徐扬王佳维指导教师:邢国光2012年 11月目录第一章引言 (1)1.1 选题依据和意义 (1)1.2 课题研究内容 (3)第二章可行性分析 (4)2.1 编写目的 (4)2.2 可行性研究任务 (4)2.2.1 开发理论与技术可行性分析 (4)2.2.2开发语言可行性分析 (5)2.2.3系统可行性分析 (6)2.2.4经济可行性分析 (6)2.3 系统运行环境需求 (6)2.3.1硬件接口 (6)2.3.2软件接口 (6)2.4 系统性能需求 (7)2.5 可行性研究结论 (7)第三章需求分析 (8)3.1 编写目的 (8)3.2 系统需求分析 (8)3.2.1系统功能需求 (8)3.2.2系统界面需求 (8)3.2.3系统安全行需求 (8)3.3数据流图 (8)3.3.1顶层数据流图 (9)3.3.2数据流图 (9)3.4 数据字典 (11)第四章系统设计 (13)4.1 编写目的 (13)4.2 后台设计 (13)4.2.1后台功能模块图 (13)4.2.2前台功能模块图 (14)4.3 数据库设计 (14)4.3.1数据库描述 (14)4.3.2数据库概念设计 (14)4.3.3数据库的逻辑设计 (16)第五章详细设计及实现 (18)5.1 编写目的 (18)5.2 整体框架 (18)5.2.1类设计 (18)5.2.2文件结构 (19)5.3 各类用户登陆类 (19)5.4 数据库的连接及相关操作类 (20)5.5 系统程序流程图 (23)5.6 系统用户权限 (25)5.6.1系统用例图: (25)5.6.2管理员子用例图: (26)5.7 功能模块设计 (27)5.7.1后台功能模块图: (27)5.8 前台设计 (35)5.8.1前台功能模块图 (35)5.8.2客户端模块描述 (35)参考文献 (37)第一章引言1.1 选题依据和意义随着中国经济的快速发展,中国的物流业正在迅速发展,成为广受关注的一个经济热点。

NIT大作业-WORD

NIT大作业-WORD
iii. 秋风瑟瑟,奏起了一曲念想的殇歌。你能听到,我在风中浅吟低唱吗?雪小禅说,每个女子都是自己的杜丽娘,心中都有一份一个人的爱情,一个人的芬芳。而你,就是我此生的芬芳。我愿用一世去等待、去守候。
还记得,那年麦田里,我们留下的誓言吗?执子之手,与子 偕老。多么美丽,却又是多么凄凉的文字啊。对于每个女子而言,这是一句永远听不厌的誓言,而我,也同样如此,曾经被你的誓言感动着。你伸手拂去我的泪,我就那样静静的依偎在你的怀里,那是我永世无法忘却的记忆。
1班
张静
83
86
74
243
010
1班
刘旭
81
80
55
216
成绩单
学号
班级
姓名
英语
高数
语文
总成绩
001
1班
王杰
76
79
74
229
002
1班
田天
68
81
49
198
003
1班
张小川
81
65
67
213
004
1班
李丽
86
88
91
265
005
1班
陈晨
76
78
92
246
006
1班
张卫健
56
67
78
201
007
1班
李强907867235008
1班
张辉
81
79
91
251
009
人这一生,总有那么一个人,会是你永远解不开的结、躲不掉的劫。就有那么一个人,会让你不断地用眼泪去诠释着关于那个人的记忆,也就是那样的一个人,会让你在无数梦醒时分将那个人细细的回想着。总有那样的一个人,会让你留下数不清的相思泪,做不完的痴心梦,写不完的朦胧诗。而你就是我今世地那个人。

大学英语期末大作业(参考答案)

大学英语期末大作业(参考答案)

大学英语1考试卷总分:100分简答题1、将下列句子翻译成汉语1.We can do a lot of things onlinesuch assearching for information and communicating with friendsno matter how far.答案:我们可以在网上做很多事情,例如寻找信息及和朋友沟通,不管相距多远。

2.Some people seem tohave their own ability in learning language答案:有些人在学习语言方面似乎有自己的天赋.3.It is necessary for them to learn the language in order to communicate with these people and to learn from them.答案:为了与这些人进行交流,向他们学习,学习这门语言是必要的4.Our likes and dislikes, tastes and preferences that hide in our choices of such activities such as reading books, going to the cinema, camping, or certain cultural pursuits, are all related to social background and learning experiences.答案:我们的好恶、品位、喜好决定了我们是选择看书、看电影、露营或某种文化追求,这又同社会环境和学习经验有关。

5.Occasionally, for a formal party or dinner, an invitation requires an answer,either in writing or by telephone.答案:偶尔,一个正式的聚会或晚宴, 被邀请人是需要做出明确答复的, 无论是通过书面或者电话.选择性答案2:应邀出席正式宴会或晚餐,不管是用书面还是用电话,有时是要回复的。

NIT大作业Word范例

NIT大作业Word范例

颗心之间轻轻传递。

那些寂寞离愁,那些累累伤痕,都在缓缓淡去。

无声的语言,平静散淡的心态,一切都似那一轮初生的朝阳,映衬着寂寥的情怀。

◆想你,在你看不到的远方,
而我的手,正在穿越时空,
去触摸你幸福时的模样。

◆念你,在这个浪漫的春天我,
我用文字为你打造一个姹紫
嫣红的世界,我的激情,再
为你上演一场风花雪月。

该怎样珍藏这段岁月,让生命开
得更美。

其实我清晰的明白,生命是
终将荒芜的渡口,连我们都是过客。

人生不过是一场偶遇,快乐或悲伤,
也只是昙花一现。

我,不是你的童话,你,也不是我的天使。

多刚体大作业2(maple)

多刚体大作业2(maple)

MAPLE理论力学学号:201431206024一、如图1,长0.40m l =、质量 1.00kg M =的匀质木棒,可绕水平轴O 在竖直平面内转动,开始时棒自然竖直悬垂,现有质量8g m =的子弹以200m/s v =的速率从A 点射入棒中,A 、O 点的距离为3/4l ,如图所示。

求:(1)棒开始运动时的角速度; (2)棒的最大偏转角。

解:(1)子弹射入前,子弹角动量为: l L 43mv 1⋅= 子弹射入后,木棒角动量为:ω22M 31l L =子弹射入后,子弹角动量为:ω23)43m(l L =应用角动量守恒定律:321L L L =+22313434mv l Ml m l ωω⎛⎫⋅=+ ⎪⎝⎭解得:3333810200448.9rad/s 191918100.4316310mv M m l ω--⨯⨯⨯===⎛⎫⎛⎫+⨯+⨯⨯⨯ ⎪ ⎪⎝⎭⎝⎭(2)子弹射入后,子弹角动能:221M 3121ωl E k ⋅=子弹射入后,木棍角动能:222)43m(21ωl E k =子弹摄入后,子弹重力势能:gl E M 211p -=子弹摄入后,木棍重力势能:gl E m 432p -=最大偏角时,子弹重力势能:θcos M 213p gl E -=最大偏角时,木棍重力势能:θcos m 434p gl E -=应用机械能守恒定律:432121p p p p k k E E E E E E +=+++2211333()cos cos 2342424l l l lMl m l Mg mg Mg mg ωθθ⎡⎤+--=--⎢⎥⎣⎦图1图2解得 2938cos 10.07923M ml M m gθω+=-⋅=-+, 94.5θ=︒答案:(1)8.9rad/s ;(2)94.5︒。

● Maple 程序:> restart: #清零> L[1]:=3/4*m*v*l: #射入前子弹的角动量L1 > L[2]:=1/3*M*omega*l^2: #射入后木棒的角动量L2 > L[3]:=m*(3/4*l)^2*omega: #射入后子弹的角动量L3 > eq1:= L[1]= L[2]+ L[3]: #角动量守恒> Ek[1]:=1/2*1/3*M*l^2*omega^2: #射入瞬间木棒角动能 > Ek[2]:=1/2*1/3*M*l^2*omega^2: #射入瞬间子弹角动能 > Ep[1]:=-1/2*M*g*l: #射入瞬间木棒重力势能 > Ep[2]:=-3/4*m*g*l: #射入瞬间子弹重力势能 > Ep[3]:=-1/2*M*g*l*cos(theta): #最大偏转时木棒重力势能 > Ep[4]:=-3/4*m*g*l*cos(theta): #最大偏转时子弹重力势能 > eq2:= Ek[1]+ Ek[2]+ Ep[1]+ Ep[2]= Ep[3]+ Ep[4]: #角动量守恒 > l:=0.4:M=1:m=0.008:v=200:g=9.8: #已知条件 > solve({eq1,eq2},{omega,theta}): #解方程二、如图3,一根长为l 、质量为M 的匀质棒自由悬挂于通过其上端的光滑水平轴上。

江苏开放大学《大学英语B(2)》综合性大作业

江苏开放大学《大学英语B(2)》综合性大作业

精选《大学英语B (2)》综合性大作业》综合性大作业任选一个主题作为论文题目,围绕主题写一篇800字论文提交(中英文均可)。

1.《从节日看中西文化差异》《从节日看中西文化差异》2.《从中英文动物比喻的不同看中西文化差异》《从中英文动物比喻的不同看中西文化差异》3.《论中英文中颜色隐喻的差异及其文化根源》《论中英文中颜色隐喻的差异及其文化根源》4.《论跨文化交际中的中西餐桌礼仪》《论跨文化交际中的中西餐桌礼仪》5.《从跨文化交际的角度解读中西方礼貌准则和策略》《从跨文化交际的角度解读中西方礼貌准则和策略》6.《中西方茶文化差异》《中西方茶文化差异》作业要求:作业要求:1. 主题明确,结构清晰,内容饱满,充分阐述中西文化差异;主题明确,结构清晰,内容饱满,充分阐述中西文化差异;2. 请勿抄袭!!!!江苏开放大学综合性大作业学 号 2017130000012姓 名苏文龙课程代码020004课程名称大学英语B(2) 评阅教师分 数评 语标题标题 《中西方茶文化差异》《中西方茶文化差异》正文正文 Differences between Chinese and western tea culturesTea originated in China, and the earliest wri en records date back to the 2nd century BC and then spread to the west. However, there are different customs for drinking tea in different cultural backgrounds. Here's a look at some of the differences between Chinese and western tea cultures that have been carefully sorted out for you.(1) different ways of drinking.There are two types of Chinese tea drinking, one is "clear drink", without adding any harmful ingredients to the original flavor of the tea, and only drink with water bubbles. The other is "mixed drink", which means adding salt, sugar and milk to tea according to personal taste. Currently, this method is mainly concentrated in ethnic minority areas.Britons add milk and sugar to their tea to remove theophylline and turn bi er tea into sweet drinks that suit their tastes. In addi on, the English have reformed the tea itself. Packaged, instant tea scraps replace pieces of tea, and Chinese people tend to keep the whole leaf in boiling water.Western tea can be added milk, sugar, lemon slices and honey, etc., but it is important to note that tea should be poured first,followed by other condiments, in an order that cannot be reversed. A er adding the seasonings, s r with the spoon to avoid making too much noise when s rring the tea. Put the spoon on the back of the bowl a er s rring.(2) the use of tea sets is differentChina's tea wares are mostly ceramic products, and there are also purple sandboxes for pu 'er tea. The purple sand teapot is breathable, and the pu-erh tea is brewed. The watertemperature must be very high.And westerners have a special liking for silver, so most westerntea wares are made of silver.The use of tea filters is differentIn China, the chip off a fine cup of tea, such as aged pu-erh tea,need to use iron pot as tools to boil water, then water into theteapot and tea, pour out the first me a er water, then addboiled water into the teapot in let stand un l the bubble tea,just take a small sample.As is known to all, Chinese people are quite par cular aboutthe tea ceremony. In fact, westerners also have a set ofe que e when drinking tea. For example, western teas use atea strainer, which is placed on a teacup and poured into thecup un l it is three-quarters full, so it doesn't spill over thesaucer and make a mess.(4) differences in tea drinking e que e.In the eyes of most Chinese, tea can be drunk at any me. The Bri sh are much more tea - loving and tea - respec ng. A typical Bri sh family drinks tea at least five mes a day. When you wake up in the morning, the host will lean on the bed and drink a cup of morning tea to refresh your mind. If there are guests, morning tea is the best way to greet them. Around 11 o 'clock in the morning, black tea with tea; Drink milk tea at lunch; Around five o 'clock in the a ernoon is the famous a ernoon tea. Drink farewell tea before going to bed at night. In addi on, there are many famous tea banquet, garden tea party and so on.(5) differences in the spirit of tea ceremony.Harmony, tranquility, grace and truth are the four noble truths of Chinese tea ceremony. Harmony is the core of Chinese teaculture philosophy and the soul of tea ceremony. "Quiet" is the only way to prac ce Chinese tea ceremony. "Just" is thespiritual feeling in the prac ce of Chinese tea ceremonyprac ce. "True" is the ul mate pursuit of Chinese teaceremony. Chinese people o en drink tea as a spiritualinspira on and emo onal sustenance. Unlike the Chinese teaceremony, the Bri sh taste tea more lively and social,emphasizing an elegant style.Oriental tea wares are mostly ceramic products, while westerntea wares are mostly silver.Oriental people pay a en on to tea ceremony, westerners alsohave a set of tea ceremony, such as to use a tea filter, to pourtea into the cup to three-quarters full.Chinese tea is the purest flavor of the tea without adding anyflavoring to it. Western tea is added milk, sugar, lemon slicesand honey, the tea should be poured before adding othercondiments, the order cannot be reversed.Tea is not required to be served in the east, but it is o enaccompanied by tea in the west. The most common ones areSco sh cream biscuits, Victorian muffins and muffins.。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
a[i]=k;
Shift(a,0,i);
}
}
void MergeSort(int R[],int low,int high){//归并排序
int mid;
if(low<high){
mid=(low+high)/2;
MergeSort(R,low,mid);
MergeSort(R,mid+1,high);
8、程序开发总结(简要叙述编写本作业的收获与思考)
通过本次编程我了解到C语言的博大精深和自己的不足,在思维的碰撞中提高了自己,同时也学习过到了新的知识,使自己的程序更加逻辑化、条理化。
我也发现了利用身边的一切资源和进行自我学习的重要性,为以后的工作和学习积累了宝贵的经验。
同时我也意识到老师上课强调的细节对我的帮助,有效的对所学知识进行了巩固和训练。
#include ""
int main()
{
int a[100],n,i,k;
while(1){
printf("\n\t\t\t欢迎使用排序算法演示程序\n\n\n");
printf("请输入所要排序的数据个数N(N<100)=");
scanf("%d",&n);
printf("\n");
printf("请输入所要排序的数据:");
5、程序文件与工程名称(标出程序中所有文件名、工程名称及其说明)
工程的名称:排序算法演示程序
包含的程序原文件如下:
主函数、输入和输出数据、显示菜单、选择排序方法
2.
实现7种排序的函数
3.
7种排序函数及其附属函数的声明
6、函数模块(程序中各个函数的原型声明及其说明)
void Bubble(int a[],int n);冒泡排序
int i,k;
for(i=n/2-1;i>=0;i--) Shift(a,i,n);//初始化操作:将a[n]构造为初始堆
for(i=n-1;i>=1;i--){//每一趟排序的基本操作:将当前无序区的
k=a[0]; //堆顶记录a[1]和该区间的最后一个记录交换,
a[0]=a[i]; //然后将新的无序区调整为堆(亦称重建堆)
Merge(R,low,mid,high);//重复运行
}
}
void Merge(int *R,int low,int m,int high){
int i=low,j=m+1,p=0;
int *R1;
R1=(int *)malloc((high-low+1)*sizeof(int));//申请空间,用以放置合并后的序列
printf("\n\n\t");
for(i=0;i<n;i++) scanf("%d",&a[i]);泡排序\t 2.选择排序\t 3.插入排序\n");
printf("\t4.快速排序\t 5.堆排序\t 6.归并排序\t 7.基数排序\n\n");
printf("您的选择是:");
scanf("%d",&k);
因此,我将目前比较流行的7种排序法:
1.冒泡排序2.选择排序3.插入排序
4.快速排序5堆排序6归并排序
7.基数排序
加以总结,标明注释,成为这个演示程序,以供交流学习使用。
2、开发工具(列出所使用的开发工具和第3方开发库)
Code::block
3、主要功能(详细说明程序的功能)
基本功能:本程序可实现对100个及以下的数据排列的功能。
switch(k){
case 1: Bubble(a,n);break;
case 2: Selection(a,n);break;
case 3: Insertion(a,n);break;
case 4: Quick(a,n,0,n-1);break;
case 5: Heap(a,n);break;
case 6: MergeSort(a,0,n-1);break;
t=a[i];
a[i]=a[i+1];
a[i+1]=t;//交换
}
}
void Selection(int a[],int n){//选择排序
int i,j,k,t;
for(i=0;i<n-1;i++){
k=i;
for(j=i+1;j<n;j++)
if(a[j]<a[k])k=j;//找出最小数
if(i!=k){
if(k=1){
for(i=0;i<n;i++) printf("%d ",a[i]);//正序输出
}
else{
for(i=n-1;i>=0;i--) printf("%d ",a[i]);//倒序输出
}
printf("\n\n按Q键并确认退出,其他任意键继续:");
getchar();
if(getchar()=='q') break;
6.归并排序
将已有序的子序列合并,得到完全有序的序列;即先使每个子序列有序,再使子序列段间有序。若将两个有序表合并成一个有序表,称为二路归并。
首先申请空间,使其大小为两个已经排序序列之和,该空间用来存放合并后的序列。设定两个指针,最初位置分别为两个已经排序序列的起始位置。比较两个指针所指向的元素,选择相对小的元素放入到合并空间,并移动指针到下一位置。重复直到某一指针超出序列尾。将另一序列剩下的所有元素直接复制到合并序列尾。
9、运行截图(附上程序运行的截图画面,至少有1幅,截图越翔实得分越高)
Windows中抓取当前活动窗口:Alt + Print Screen,抓取全屏:Print Scre代码,若是多个文件,标出文件名)
<>
#include <>
case 7: int *a_p = a;Bucket(a_p,n);break;
}
printf("\n");
printf("请选择排列方式:1.从小到大2.从大到小\n\n");
printf("您的选择是:");
scanf("%d",&k);
printf("\n\n");
printf("结果是:\n\t");
if((k<m-1)&&(a[k]<a[k+1])) k ++;
if(t<aຫໍສະໝຸດ k]){a[i]=a[k];//使数列成为一棵完全二叉树的存储结构
i=k; //即成为小根堆
k=2*i+1; //ki<=k(2i)且ki<=k(2i+1)(1≤i≤n)
}
else break;
}
a[i]=t;
}
void Heap(int a[] , int n){//堆排序
2.选择排序
第i趟选择排序通过n-i次关键码的比较,从n-i+1个记录中选出关键码最小的记录,并和记录i交换。
3.插入排序
把新插入记录的关键码与已排好序的逐个比较,但找到第一个比其大的记录时,该记录之前即为插入位置k。从序列最后开始到该记录,逐个后移一个单元,将新纪录插入k位置。如果新纪录比其他记录都大,则插入到最后。
a[left]=a[j];
a[j]=t;
Quick(a,n,left,j-1);
Quick(a,n,j+1,right);//左右半部分分别再次快速排序
}
}
void Shift(int a[] , int i , int m){//建堆
int k,t;
t=a[i];
k=2*i+1;
while(k<m){
k--;
if(k==-1)break;
}
a[k+1]=t;//插入原数据
}
}
void Quick(int a[],int n,int left,int right){
//快速排序,left、right分别为数组左右边界
int i,j,t;
if(left<right){
i=left;
j=right+1;
while(1){
while(i+1<n&&a[++i]<a[left]);//向后搜索大于a[left]的数
while(j-1>-1&&a[--j]>a[left]);//向前搜索小于a[left]的数
if(i>=j)break;
t=a[i];
a[i]=a[j];
a[j]=t;//交换
}
t=a[left];
作业名称:
算法演示程序
学 院:
航海学院
班 级:
03011403
学 号:
51
姓 名:
苏和
团队组成:
西北工业大学
2020年7月10日
1、问题与背景(描述程序所要解决的问题或应用背景)
C语言经过几十年的发展已经发展出多种多样的的排序方法,网上的解释和代码良莠不齐,许多具有严重的错误,给学习者打来极大的不便。
void Selection(int a[],int n);选择排序
void Insertion(int a[],int n);插入排序
相关文档
最新文档