Singly linked list exercise in C
This is pretty good. Minor points:

You can return just root in createList:

ListElement * createList(int size) {
    ListElement *root;
    ListElement *current;
    root = malloc(sizeof(ListElement));

    if (root != NULL) {
        root-&gt;value = 0;
        current = root;
        int i;

        for (i = 1; i &lt; size; i++) {
            current-&gt;next = malloc(sizeof(ListElement));

            if (current-&gt;next != NULL) {
                current-&gt;next-&gt;value = i;
                current = current-&gt;next;
            } else {
                freeList(root);
                return NULL;
            }
        }
    }

    return root;
}


And your freeList is O(n^2) complex, because you are removing from the end. Removing from the beginning would make it O(n).