Data Structures Using C (original) (raw)

What is one primary advantage of using a linked list over an array?

Why is linked list preferred over array for implementing a stack when the size is not known in advance?

Which statement is true about adjacency list representation of a graph?

A queue is implemented using the following structure:

C `

struct QNode { int data; struct QNode* next; }; struct Queue { struct QNode *front, *rear; };

`

Which operation should be performed after a dequeue() that removes the last element?

What does the following function compute?

C `

int count(struct Node* root) { if (root == NULL) return 0; return 1 + count(root->left) + count(root->right); }

`

There are 5 questions to complete.

Take a part in the ongoing discussion