3
Data Structures and Algorithms (Fall 2012) Guidelines for Programming Assignment #3: Problems 1 & 2 Please read the guidelines properly and do adhere to these guidelines. Your assignment may not be evaluated and may be considered as ‘not submitted’ if you do not follow the guidelines. THE DEMO AND VIVA WILL BE SCHEDULED FROM 30-TH OCTOBER ONWARDS. BE PREPARED ACCORDINGLY. Important Note: The aim of this assignment is not just implementing the algorithms, but proper experimental analysis of these algorithms. You must be able to draw useful inferences about the algorithms (like time complexity, how does algorithm behave on large input sizes, which algorithm is better for practical applications etc) depending on your experimental observations, and justify these inferences. JUST IMPLEMENTING THE ALGORITHMS WILL NOT GET YOU MARKS. You are expected to have a proper understanding and insight about the behaviour of the algorithms. A significant portion of the marks will depend on the inferences you draw. Also, in problem 2, plots have not been explicitly asked for, but it is implied in the problem. YOU MUST SUBMIT THE PLOTS FOR BOTH THE PROBLEMS IN ORDER TO JUSTIFY YOUR INFERENCES. ALSO NOTE THAT THE EXPERIMENTAL OBSERVATIONS WILL BE VERIFIED AT THE TIME OF DEMO. Reports: REPORT FOR EACH PROBLEM MUST NOT BE MORE THAN 2 PAGES. Include in the report, the answers to theoretical questions asked, experimental results, plots, and the inferences that you have made. Reports must be concise and to the point. Plots must be properly scaled and readable. The reports must be typed and you need to bring the print outs of the reports. You must make plots using some s/w tools (gnuplot, matlab, excel etc) and get their print outs. HAND DRAWN PLOTS WILL NOT BE ACCEPTED. The plots must be such that you can draw useful inferences from them, like which algorithm is better, what’s the time complexity and how does algorithm behave on very large input sizes. Therefore choose the scales intelligently. THE EXPERIMENTAL RESULTS THAT YOU MENTION IN THE PLOTS OR OTHERWISE WILL BE VERIFIED AT THE TIME OF DEMO. In assignment #1, many students had drawn the plots as expected according to the theoretical time complexity of the algorithm and they lost marks. PLEASE NOTE THAT YOU HAVE TO DRAW THE EXPERIMENTAL PLOTS. DO NOT UPLOAD THE REPORTS IN MOODLE. BRING THE REPORTS IN THE CLASS AT 9:00AM ON 29-TH OCTOBER. Programs: Problem 1: Input and Output format: The program must take 2 inputs in the following order.

Guidelines for Programming Assignment 3_revised (1).pdf

Embed Size (px)

Citation preview

Data Structures and Algorithms (Fall 2012) Guidelines for Programming Assignment #3: Problems 1 & 2

Please read the guidelines properly and do adhere to these guidelines. Your assignment may not be evaluated and may be considered as ‘not submitted’ if you do not follow the guidelines.

THE DEMO AND VIVA WILL BE SCHEDULED FROM 30-TH OCTOBER ONWARDS. BE PREPARED ACCORDINGLY.

Important Note: The aim of this assignment is not just implementing the algorithms, but proper experimental analysis of these algorithms. You must be able to draw useful inferences about the algorithms (like time complexity, how does algorithm behave on large input sizes, which algorithm is better for practical applications etc) depending on your experimental observations, and justify these inferences. JUST IMPLEMENTING THE ALGORITHMS WILL NOT GET YOU MARKS. You are expected to have a proper understanding and insight about the behaviour of the algorithms. A significant portion of the marks will depend on the inferences you draw.

Also, in problem 2, plots have not been explicitly asked for, but it is implied in the problem. YOU MUST SUBMIT THE PLOTS FOR BOTH THE PROBLEMS IN ORDER TO JUSTIFY YOUR INFERENCES.

ALSO NOTE THAT THE EXPERIMENTAL OBSERVATIONS WILL BE VERIFIED AT THE TIME OF DEMO.

Reports:

REPORT FOR EACH PROBLEM MUST NOT BE MORE THAN 2 PAGES. Include in the report, the answers to theoretical questions asked, experimental results, plots, and the inferences that you have made. Reports must be concise and to the point. Plots must be properly scaled and readable. The reports must be typed and you need to bring the print outs of the reports. You must make plots using some s/w tools (gnuplot, matlab, excel etc) and get their print outs. HAND DRAWN PLOTS WILL NOT BE ACCEPTED. The plots must be such that you can draw useful inferences from them, like which algorithm is better, what’s the time complexity and how does algorithm behave on very large input sizes. Therefore choose the scales intelligently. THE EXPERIMENTAL RESULTS THAT YOU MENTION IN THE PLOTS OR OTHERWISE WILL BE VERIFIED AT THE TIME OF DEMO. In assignment #1, many students had drawn the plots as expected according to the theoretical time complexity of the algorithm and they lost marks. PLEASE NOTE THAT YOU HAVE TO DRAW THE EXPERIMENTAL PLOTS.

DO NOT UPLOAD THE REPORTS IN MOODLE. BRING THE REPORTS IN THE CLASS AT 9:00AM ON 29-TH OCTOBER.

Programs:

Problem 1:

Input and Output format: The program must take 2 inputs in the following order.

1) Value of n (number of bits in the 2 numbers) 2) An integer choice(will have value either 1 or 2)

Generate two n bit numbers randomly and proceed as follows. If the user enters choice as 1, then the program should first display the two n bit numbers and then it should display the multiplication as obtained by the 2 algorithms separately.

If the choice is 2, then the program should display the time taken by both the algorithms in multiplying the two numbers. The time should be as precise as possible. In this case you don’t need to output the numbers or the multiplication.

You may modify your code to get the experimental results but the final code that you submit should be according to above specifications. ALSO NOTE THAT THE EXPERIMENTAL RESULTS AND THE OBSERVATIONS FROM THE PLOTS WILL BE VERIFIED AT THE TIME OF DEMO.

Problem 2:

Input and Output format: The program must take 2 inputs in the following order.

1) Value of n (number of elements to be sorted) 2) An integer choice(will have value either 1 or 2)

Generate n numbers randomly and proceed as follows. If the user enters choice as 1, then the program should first display the n numbers and then the sorted lists as obtained by merge sort and quick sort separately.

If the choice is 2, then the program should display the time taken by both the algorithms in sorting n numbers. The time should be as precise as possible. In this case you don’t need to output the numbers or the sorted lists.

You may modify your code to get the experimental results but the final code that you submit should be according to above specifications. ALSO NOTE THAT THE EXPERIMENTAL RESULTS AND THE OBSERVATIONS FROM THE PLOTS WILL BE VERIFIED AT THE TIME OF DEMO.

Marks Breakup

Each problem is of 50 marks divided as follows:

Problem 1: Program and Demo: 20 marks Viva and Report: 30 marks

Problem 2: Program and Demo: 10 marks Viva and Report: 40 marks

Other Instructions The programs must be in C and must compile in GCC compiler. The constraint of programming language has been imposed so that programs can be easily checked for plagiarism using moss.

The programs should be readable and you should use good programming habits.

The programs should have separate functions for separate tasks.

Proper comments must be given wherever necessary.

Programs will be checked for plagiarism in moss and strict action shall be taken if plagiarism is observed. The reports will also be checked for plagiarism. There is zero tolerance for plagiarism.

Name the program as rollno_rollno_programno.c. For example, the name of the program 1 submitted by the group having roll numbers 10308 and Y9234 must be 10308_Y9234_program1.c

Zip the 2 programs as rollno_rollno_ProgAssign3.zip. For example, the name of the zip file submitted by the group having roll numbers 10308 and Y9234 must be 10308_Y9234_ProgAssign3.zip. Upload this zip file in moodle.

Not adhering to guidelines attracts penalty. It has been observed that many students did not follow the guidelines in the first two assignments (In fact many students were not even aware that guidelines have been uploaded). Even the naming conventions were not followed. No excuses shall be entertained this time. You may be awarded zero marks if such carelessness is observed.