To make it clear what to include in the assignment with respect to the first part of the course project, an example was given in the note of Aug 27th.
Suppose you were going to do data structure selection for a singly linked list, the following submission would be appropriate.
====================================================================================================
We use two types of C structures (records in Pascal) to implement singly linked lists.
The structure 'list' always keeps a pointer to the first node of the list,
and it will be null if the list is empty.
The 'node' data structure will have two fields, 'data' and 'next', respectively.
The field 'data' stores the data in the node, it could be any other types (integer here),
while the field 'next' is the pointer to the next node, which is null for the last node of the list.
typedef struct node {
int data; // the data stored in the node
struct node *next; // a reference to the next node in the list
} node;
typedef struct list {
node *head; // the pointer to the first node
} list;
// Appropriate comments in your code would be appreciated.
====================================================================================================
While our project is actually about Rectangle quadtrees, you should provide descriptions of rectangles, quadtree nodes and so on, through C structures or Pascal records.
Meanwhile, you are recommended to write comments and explanations besides code, in order to improve the readability.
Furthermore, another example for binary search trees is given as follows.
====================================================================================================
Two different C structures are used to represent binary search trees.
The first one 'BST' stores a reference to the root of the tree.
It will be null if the search tree has no elements.
typedef struct BST {
struct node *root; // the reference to the root of the BST
} BST;
Every node in the binary search tree may at most have two children, so the second structure 'node' contains the pointers to them.
If the node does not have either or both of the children, the corresponding pointer(s) will be null.
Besides the references, a node should also have a field for data.
typedef struct node {
int data;
struct node *left_child, *right_child; // pointers to two children of the node
} node;
====================================================================================================
Hopefully the examples above could help you understand the requirements of the first assignment of the project. : )