DSA 10 Marks Answers Part1
DSA 10 Marks Answers Part1
A stack is a linear data structure that follows the Last In First Out (LIFO) principle. The element
Operations:
Example C Program:
#include <stdio.h>
int stack[SIZE];
Applications:
- Expression evaluation
- Recursion
- Undo features
- Backtracking algorithms
Queue Implementation (Simple, Circular, Dqueue)
Queues are linear data structures that follow First In First Out (FIFO) principle.
#include <stdio.h>
#define SIZE 5
int queue[SIZE];
Linked list is a linear data structure where each node contains data and a pointer to the next node.
Example:
struct Node {
int data;
};
Operations:
- Insert at beginning
- Delete from beginning
- Display
Functions:
Algorithm:
Example C code:
#include <stdio.h>
char stack[SIZE];
Algorithm:
Example C code: