CSC3100 Data Structures

wx--codinghelp / 2024-09-26 / 原文

Requirements

Code (90%)

You can write your code in Java, Python, C, or C++. The time limit may vary among differentanguages, depending on the performance of the language. Your code must be a complete excutableprogram instead of only a function. We guarantee test data strictly compliance with the requirementsin the description, and you do not need to deal with cases where the input data is invalid.

No AI Assistance or Plagiarism: All code must be your own. The use of AI tools (e.g., ChatGPT,GitHub Copilot) or copying from external sources or peers is strictly forbidden.Violations of the plagiarism rules will result in 0 points or even failure of this course.

Libraries in this assignment:

  • For C/C++, you can only include standard library.
  • For Java, you can only import java.util.*
  • For Python, you can only import standard library. In other words, you cannot import libraries

such as numpy.We provide an example problem to illustrate the information above better.

Report (10%)

You also need to write a report in pdf type to explain the following:

  • What are the possible solutions for the problem?
  • How do you solve this problem?
  • Why is your solution better than others?

Please note that the maximum number of pages allowed for your report is 5 pages.Remember that the report is to illustrate your thinking process. Keep in mind that your report issupposed to show your ideas and thinking process. We expect clear and precise textual descriptionsin your report, and we do not recommend that you over-format your report.

Example Problem: A + B Problem

Description

Given 2 integers A and B, compute and print A + B

Input

Two integers in one line: A, and B

Output

One integer: A + B

Sample Input 1

1 2

Sample Output 1

3

Problem Scale & Subtasks

For 100% of the test cases, 0 A, B 106

Solutions

Java

import java . util .*;

public class Example {

public static void main ( String [] args ) {

int a , b;

Scanner scanner = new Scanner ( System . in );

a = scanner . nextInt ();

b = scanner . nextInt ();

scanner . close ();

System . out . println (a + b );

}

}

Python

AB = input (). split ()

A , B = int ( AB [0]) , int ( AB [1])

print (A + B )

C

# include < stdio .h >

int main ( int argc , char * argv [])

{

int A , B ;

scanf ("%d%d", &A , &B );

printf ("%d\n", A + B );

return 0;

}

C++

# include < iostream >

int main ( int argc , char * argv [])

{

int A , B ;

std :: cin >> A >> B;

std :: cout < < A + B << std :: endl ;

return 0;

}

Submission

After finishing this assignment, you are required to submit your code to the Online Judge System(OJ), and upload your .zip package of your code files and report to BlackBoard.

C.1 Online Judge

Once you have completed one problem, you can submit your code on the page on the Online Judgeplatform (oj.cuhk.edu.cn, campus only) to gain marks for the code part. You can submit yoursolution of one problem for代 写CSC3100 Data Structures   no more than 80 times.2After you have submitted your program, OJ will test your program on all test cases and give you agrade. The grade of your latest submission will be regarded as the final grade of the corresponding

Note:

The program running time may vary on different machines. Please refer to the result ofte online judge system. OJ will show the time and memory limits for different languages on thecorresponding problem page.If you have other questions about the online judge system, please refer to OJ wiki (campus networkonly). If this cannot help you, feel free to contact us.

C.2 BlackBoard

You are required to upload your source codes and report to the BlackBoard platform. You need

to name your files according to the following rules and compress them into A1_<Student ID>.zip :

A1_ < Student ID >. zip

|-- A1_P1_ < Student ID >. java / py /c/ cpp

|-- A1_P2_ < Student ID >. java / py /c/ cpp

|-- A1_Report_ < Student ID >. pdf

For Java users, you don’t need to consider the consistency of class name and file name.

For example, suppose your ID is 123456789, and your problem 1 is written in Python, problem 2 is

written in Java then the following contents should be included in your submitted A1_123456789.zip:

A1_123456789 . zip

|-- A1_P1_123456789 . py

|-- A1_P2_123456789 . java

|-- A1_Report_123456789 . pdf

C.3 Late Submissions

Submissions after Sept. 29 2024 23:59:00(UTC+8) would be considered as LATE.The LATE submission page will open after deadline on OJ.Submisson time = max{latest submisson time for every problem, BlackBoard submisson time} There will be penalties for late submission:

  • 0–24 hours after deadline: final score = your score×0.8
  • 24–72 hours after deadline: final score = your score×0.5
  • 72+ hours after deadline: final score = your score×0

FAQs

CSC3100 Data Structures Fall 2024

Programming Assignment 1

1 Array Problem (40% of this assignment)

1.1 Description You are given a sequence of integers ai of length n. Additionally, you are given m operations to performon this sequence. Each operation is one of the following: