I was looking through the code for creating a linked list and almost everywhere I have observed that a function to add a node is given even if the number of nodes are known and then add operation for node is executed one by one for each element.

Why can't one simply create an array of nodes with new operator and assign the values from simple raw values array and just connect the links?

Something like this:

```cpp
Node* create_list(unsigned int n, unsigned int arr[]) {
    Node* head = new node[n];

    for (unsigned int i = 0; i < n; i++) {
        head[i].data = arr[i];

        if (i != n - 1)
            head[i].next = head[i + 1];
        else
            head[i].next = NULL;
    }
}

```

Is this a valid code to create a linked list from array?