Day 16 Recap Questions
  1. Describe the linked list structure by a diagram.
  2. Compare arrays and linked lists. Write down their pros and cons.
  3. What is a linked list’s head? How is it different from a node? Explain.
  4. How do you calculate length of a linked list?
  5. How do you implement add_after on a singly linked list?
  6. What is the result of running this code on the input values 1 3 5 7 9? Draw a picture representing memory.
typedef struct node_ {
     int data;
     struct node_ * next;
} IntNode;

IntNode * head = NULL;
IntNode * n;
int val;

while (scanf("%d", &val) == 1) {
   n = (IntNode *) malloc(sizeof(IntNode));
   n->data = val;
   n->next = head;
   head = n;
}