This data structure stores elements in contiguous memory locations.
What is an array?
This principle describes how elements are removed from a stack.
What is LIFO (Last In First Out)?
This operation adds an element to the rear of a queue.
What is enqueue?
This data structure consists of nodes where each node contains data and a pointer to the next node.
What is a linked list?
#include <stdio.h>
int main() {
int a = 5;
printf("%d", a++);
return 0;
}
What is 5?
Accessing an element in an array using its index takes this time complexity.
What is O(1)?
In array implementation of a stack in C, this variable keeps track of the top position.
What is top?
In a queue, these two pointers indicate the start and end positions.
What are front and rear?
This is the first node of a linked list.
What is the head node?
#include <stdio.h>
int main() {
int a = 2, b = 3;
printf("%d", a + b * 2);
return 0;
}
What is 8?
When inserting an element into the middle of an array, existing elements must undergo this operation.
What is shifting (elements to the right)?
This condition occurs when you try to push an element into a full stack.
What is stack overflow?
A line of vehicles waiting at a toll gate is a real-world example of this data structure.
What is a queue?
Compared to arrays, linked lists use this type of memory allocation.
What is dynamic memory allocation?
#include <stdio.h>
int main() {
int i;
for(i = 0; i < 3; i++)
printf("%d ", i);
return 0;
}
What is 0 1 2?
This condition occurs when you try to access an array element outside its defined size.
What is array index out of bounds (overflow/invalid access)?
Given stack operations: Push(10), Push(20), Push(30), Pop(), this is the element removed.
What is 30?
Given operations: Enqueue(10), Enqueue(20), Enqueue(30), Dequeue(), this is the element removed.
What is 10?
Inserting a node at the beginning of a linked list requires updating this pointer.
What is the head pointer?
#include <stdio.h>
int main() {
int arr[5] = {1, 2};
printf("%d", arr[2]);
return 0;
}
What is 0 (default initialization)?
In an automobile system storing real-time speed data, this array limitation makes frequent insertions inefficient.
What is fixed size and costly shifting of elements?
In an automobile navigation system, this stack-based process helps return to previous locations step-by-step.
What is backtracking (or reverse navigation using stack)?
Compared to a simple queue, this queue type assigns priority (e.g., emergency vehicles first in traffic systems).
What is a priority queue?
In an automobile navigation system where routes change dynamically, this feature makes linked lists more suitable than arrays.
What is dynamic size (easy insertion and deletion)?
#include <stdio.h>
int main() {
int x = 5;
if(x = 10)
printf("True");
else
printf("False");
return 0;
}
What is True?