Complete the code to declare an array of 5 integers.
int arr[[1]];The array size must be 5 to hold 5 integers.
Complete the code to define a node struct for a singly linked list.
struct Node {
int data;
Node* [1];
};The pointer to the next node in a singly linked list is usually named next.
Fix the error in the code to correctly allocate memory for a new node.
Node* newNode = (Node*) malloc(sizeof([1]));We must allocate memory for a Node, not for other types.
Fill both blanks to traverse an array and print its elements.
for (int [1] = 0; [2] < size; ++[1]) { std::cout << arr[[1]] << " "; }
The loop variable is 'i' and must be used consistently in the condition.
Fill all three blanks to insert a new node at the beginning of a linked list.
Node* newNode = new Node(); newNode->data = value; newNode->[1] = [2]; head = [3];
To insert at the start, set newNode->next to head, then update head to newNode.
