ࡱ> DFC bjbjdd 4.\\,$!:5555>Nb  "r%J nnn 55 nF55 n Vk@/ 5PoFG8q"  0$!x%8%/ %/ nnnnnnn nnn$!nnnn%nnnnnnnnn\ e: CSCE 221 Cover Page Programming Assignment #4 First Name: Last Name: UIN: Any assignment turned in without a fully completed coverpage will receive ZERO POINTS. Please list all below all sources (people, books, webpages, etc) consulted regarding this assignment: CSCE 221 Students Other People Printed Material Web Material (URL) Other 1. 1. 1. 1. 1. 2. 2. 2. 2. 2. 3. 3. 3. 3. 3. 4. 4. 4. 4. 4. 5. 5. 5. 5. 5. Recall that University Regulations, Section 42, define scholastic dishonesty to include acquiring answers from any unauthorized source, working with another person when not specifically permitted, observing the work of other students during any exam, providing answers when not specifically authorized to do so, informing any person of the contents of an exam prior to the exam, and failing to credit sources used. Disciplinary actions range from grade penalties to expulsion. Please consult the Aggie Honor System Office for additional information regarding academic misconduct it is your responsibility to understand what constitutes academic misconduct and to ensure that you do not commit it. I certify that I have listed above all the sources that I consulted regarding this assignment, and that I have not received nor given any assistance that is contrary to the letter or the spirit of the collaboration guidelines for this assignment. Todays Date: Printed Name (in lieu of a signature): Sorting Due: April 15, 2015 11:59pm Description: For this programming assignment, you will implement several different sorting algorithms and study their performance. You will implement (1) Bubble Sort, (2) Heap Sort, (3) Merge Sort, and (4) (deterministic) Quick Sort. We will test your implementations using a set of numbers in a text file named numbers.txt. Each line of the file will contain a number. The first number will be which sorting algorithm to use (1=Bubble Sort, 2=Heap Sort, 3=Merge Sort, 4=Quick Sort). The second number will be the number of remaining elements in the file, n. The first two numbers of the file (sorting algorithm and n) will NOT be sorted. However, the remaining n numbers will be sorted. Here is an HYPERLINK "http://faculty.cs.tamu.edu/schaefer/teaching/221_Spring2015/Assignments/numbers.txt"example numbers.txt file. You should already have a heap working from the previous assignment. However, if you do not, here is an HYPERLINK "http://faculty.cs.tamu.edu/schaefer/teaching/221_Spring2015/Assignments/Heap.h"implementation of a heap. You should print the sorted set of numbers to the screen. Using your four implementations, you will also time how long it takes to sort n numbers. You should test your sorts on three different types of inputs: sorted, the reverse of sorted order, and random. You may use a random number generator as opposed to the file input above. Time how long sorting takes using the  HYPERLINK "http://faculty.cs.tamu.edu/schaefer/teaching/221_Spring2015/Assignments/StopWatchTest.zip" StopWatch class we provided (you dont need to print the numbers when timing). You should measure the total time at different values of n. You will then show a graph of the sort time versus the number of elements for each implementation and type of input. Coding Portion (50 Points): Create the four implementations of the different sorting algorithms. Be sure to test the correctness of your algorithms and implementations (we will). Your code will be graded based on whether or not it compiles, runs, produces the expected output, produces correct output, whether or not your experimental setup is correct, and your coding style (does the code follow proper indentation/style and comments). Report (50 Points): You will write a brief report that includes theoretical analysis, a description of your experiments, and discussion of your results. At a minimum, your report should include the following sections: Introduction. In this section, you should describe the objective of this assignment. Theoretical Analysis. In this section, you should provide an analysis of the complexity of each sorting algorithm on the different input types. What do you expect the complexity should be for each algorithm and input type? Experimental Setup. In this section, you should provide a description of your experimental setup, which includes but is not limited to Machine specification How did you generate the test inputs? What input sizes did you test? Why? Did you use something other than an array for your data structure? If so, why? How many times did you repeat each experiment? Experimental Results. In this section, you should compare the performance (running time) of the sort operation for the four different sorting algorithms to one another and to their theoretical complexity. Make a plot showing the running time (y-axis) vs. the number of elements (x-axis). You must use some electronic tool (matlab, gnuplot, excel, ) to create the plot hand-written plots will NOT be accepted. Provide a discussion of your results, which includes but is not limited to: Which of the sorting algorithms performs the best? Does it depend on the input? To what extent does the theoretical analysis agree with the experimental results? Attempt to understand and explain any discrepancies you note. ,-.p^ _ 񰢗o`T`HT`<`hq6CJOJQJaJh#&CJOJQJaJhOCJOJQJaJhQxhqECJOJQJaJhQxhV=5CJ OJQJaJ h#&5CJ OJQJaJ hQxhHBOJQJhQxh IOJQJhQxh I5OJQJ\hQxh OJQJh#&CJOJQJaJhQxCJOJQJaJhQxhqECJOJQJaJhQxh]CJOJQJaJhQxh CJOJQJaJ./op- . x gdqE$a$gdQxgd $a$gd  ;+-.;?ETfjkly !9:;ѽѽٱѥh;ah;a0JOJQJjhOOJQJUhOOJQJjh;aOJQJUh;ahw6OJQJh;ah;a6OJQJh1dOJQJh;aOJQJhwOJQJh#&OJQJhQxhqE5OJQJhQxhqEOJQJ2 YZ eSi6  & FgdQx & FgdQx & FgdD & FgdDgdD & FgdDgdwgd;agdqE;XZei%+J]anop~  NQ}n}a}hxhx0JOJQJjXhxOJQJUjhxOJQJUhxOJQJhQxhlOJQJhOJQJh#&h_6OJQJh_OJQJhwOJQJh8OJQJh`h#&0JOJQJj1hOOJQJUhOOJQJjh`OJQJUh#&OJQJ&QRv cdeFi·巄ynh#&h#&OJQJh#&hQxOJQJhQxhD6OJQJhQxhD5OJQJhQxhPSOJQJhPSOJQJhDOJQJhQxhDOJQJhQxhQxOJQJhQxhl5OJQJh#&h#&6OJQJh#&OJQJhQxhlOJQJh_OJQJ)6JDM-@ӻh M$OJQJhQxOJQJh#&OJQJhQxhQxOJQJhQxhQx6OJQJh#&hQxOJQJh#&h_OJQJ q & FgdQx21h:p]/ =!"#$% 1DyK yK http://faculty.cs.tamu.edu/schaefer/teaching/221_Spring2015/Assignments/numbers.txtyX;H,]ą'c'DyK yK http://faculty.cs.tamu.edu/schaefer/teaching/221_Spring2015/Assignments/Heap.hyX;H,]ą'c=DyK yK http://faculty.cs.tamu.edu/schaefer/teaching/221_Spring2015/Assignments/StopWatchTest.zipyX;H,]ą'cj 666666666vvvvvvvvv666666>6666666666666666666666666666666666666666666666666hH6666666666666666666666666666666666666666666666666666666666666666662 0@P`p2( 0@P`p 0@P`p 0@P`p 0@P`p 0@P`p 0@P`p8XV~ OJPJQJ_HmH nH sH tH J J ]Normal dCJ_HaJmH sH tH DA`D Default Paragraph FontRiR 0 Table Normal4 l4a (k ( 0No List H`H   No SpacingCJ_HaJmH sH tH 6U@6 D0 Hyperlink >*B*phFVF PS0FollowedHyperlink >*B*phPK![Content_Types].xmlj0Eжr(΢Iw},-j4 wP-t#bΙ{UTU^hd}㨫)*1P' ^W0)T9<l#$y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xml.relsM 0wooӺ&݈Э5 6?$Q ,.aic21h:qm@RN;d`o7gK(M&$R(.1r'JЊT8V"AȻHu}|$b{P8g/]QAsم(#L[PK-![Content_Types].xmlPK-!֧6 +_rels/.relsPK-!kytheme/theme/themeManager.xmlPK-!Ptheme/theme/theme1.xmlPK-! ѐ' theme/theme/_rels/themeManager.xml.relsPK]  . ;Q  9   XXX8@0(  B S  ? _Hlt360000061 _Hlt360000062( ( @@) )  { 33,-;-+.;?ElyX e i % H J ] a ~  N v  c FDM-@b ||h`h3(>_h^`OJQJo(hHh^`OJQJ^Jo(hHohp^p`OJQJo(hHh@ ^@ `OJQJo(hHh^`OJQJ^Jo(hHoh^`OJQJo(hHh^`OJQJo(hHh^`OJQJ^Jo(hHohP^P`OJQJo(hHh^`OJQJo(hHh^`OJQJ^Jo(hHohp^p`OJQJo(hHh@ ^@ `OJQJo(hHh^`OJQJ^Jo(hHoh^`OJQJo(hHh^`OJQJo(hHh^`OJQJ^Jo(hHohP^P`OJQJo(hH^`o(. ^`hH. pL^p`LhH. @ ^@ `hH. ^`hH. L^`LhH. ^`hH. ^`hH. PL^P`LhH.b hh3(                           PS2  w M$(2q6V=W=HBqE I;aloHuQxO`_x]#&8DV1d@X@UnknownG*Ax Times New Roman5Symbol3. *Cx Arial7.@Calibri?= *Cx Courier New;WingdingsA$BCambria Math"qht':4G i" &" &203QHX $P 2!xxschaeferschaefer   Oh+'0`   ( 4@HPX schaefer Normal.dotm schaefer10Microsoft Office Word@]n2@x:Di@r48q"՜.+,D՜.+,\ hp  4Texas A&M University - Computer Science Department&   Title 8@ _PID_HLINKSAmZhttp://faculty.cs.tamu.edu/schaefer/teaching/221_Spring2015/Assignments/StopWatchTest.zip.V9Ohttp://faculty.cs.tamu.edu/schaefer/teaching/221_Spring2015/Assignments/Heap.h.wThttp://faculty.cs.tamu.edu/schaefer/teaching/221_Spring2015/Assignments/numbers.txt. !"#$%&'()*+,-./012456789:<=>?@ABERoot Entry F[G8qGData 1Table %WordDocument4.SummaryInformation(3DocumentSummaryInformation8;CompObjy  F'Microsoft Office Word 97-2003 Document MSWordDocWord.Document.89q