Referencing is a way of acknowledging the sources that you use to complete your labs and assignments. You need to provide a reference whenever you draw on someone else's code, pseudocode or ideas. You also need to provide a reference whenever you use your own previously submitted work.

Not referencing other people's work can constitute plagiarism.


How to reference

Our referencing system requires two elements: comments throughout your code to attribute any sources you used/adapted and a list of acknowledgements in the header comment of the file.

In-code comments

You must clearly attribute the source of any code, pseudocode or ideas that you use/adapt in a comment placed directly above where the code/pseudocode/idea was applied. This comment must:

  • Briefly describe its purpose
  • Contain the URL of the website from which the code or pseudocode was taken

If you are using an entire provided file from the course in your own work (such as an implementation of the Queue ADT), then you should acknowledge the source in the header comment of the file.

Examples

Acknowledgement of a code snippet:

// Gets a list of all prime numbers up to 'n'
List getPrimes(int n) {
    List res = ListNew();
    bool *prime = malloc((n + 1) * sizeof(bool));
    assert(prime != NULL);
    memset(prime, true, n + 1);
    // The following code was adapted from https://www.geeksforgeeks.org/sieve-of-eratosthenes/
    // It uses the Sieve of Eratosthenes to generate prime numbers
    for (int p = 2; p * p <= n; p++) {
        if (prime[p] == true) {
            ListAppend(res, p);
            for (int i = p * p; i <= n; i += p) {
                prime[i] = false;
            }
        }
    }
    free(prime);
    return res;
}

Acknowledgement of an entire file (provided during the course):

// Implementation of the Queue ADT using a linked list
// This file was taken from https://cgi.cse.unsw.edu.au/~cs2521/23T2/lab/02/answers


List of acknowledgements

You must include a list of acknowledgements in the header comment of each file where a source was used. Each item in the list should include a description of how the source was used, and the URL of the source.

Example:

// ... rest of the header comment
//
// Acknowledgements:
// - Implementation of the Sieve of Eratosthenes taken from
//   https://www.geeksforgeeks.org/sieve-of-eratosthenes/


Allowable sources

Course website

You are allowed to use or adapt any amount of provided code or pseudocode from the current iteration of the course. This includes lecture slides and code, tutorial questions and answers, and lab exercises and solutions.

External websites

You are allowed to use small amounts (< 10 lines) of general purpose code (not related to the assessment) obtained from external websites such as Stack Overflow.

Submitted code

You are allowed to use any amount of code that you submitted earlier in the course. You must still include a reference with a description and URL. You should use the URL of your submission from your submissions page.

Example:

// Implementation of the stack ADT
// This file was taken from my lab01 submission at
// https://cgi.cse.unsw.edu.au/~cs2521/23T1/view/main.cgi/mon09-strings/5555555/submission/lab01/Stack.c

Resource created Tuesday 14 May 2024, 06:41:43 PM.


Back to top

COMP2521 24T2 (Data Structures and Algorithms) is powered by WebCMS3
CRICOS Provider No. 00098G