This repository contains C implementations of fundamental data structures: Stack and Queue, implemented using both arrays and linked lists.
DataStructure/
├── Stack_Array_Based/ → Stack implementation using arrays
├── Stack_Linked_Based/ → Stack implementation using linked lists
├── Queue_Arary_Based/ → Queue implementation using arrays
├── Queue_Linked_Based/ → Queue implementation using linked lists
└── README.md → Project documentation
push(),pop(),peek(),isEmpty(),isFull()- Fixed-size array logic
- Used for evaluating postfix expressions and function call stacks
- Dynamically growing stack using singly linked list
- Supports all standard stack operations
- Circular queue logic using array
enqueue(),dequeue(),isEmpty(),isFull()
- Queue using linked list with front and rear pointers
- No fixed size limitation
🛠 Requires: GCC compiler or any standard C compiler
Navigate to any folder and compile the source:
cd Stack_Array_Based
gcc main.c -o stack_array
./stack_arrayDo the same for other folders:
- Stack_Linked_Based
- Queue_Arary_Based
- Queue_Linked_Based
Replace main.c with the correct file if needed.
Stack operations:
Pushed: 10
Pushed: 20
Popped: 20
Top: 10
Queue operations:
Enqueued: 5
Enqueued: 9
Dequeued: 5
Front: 9
Aya Mohamed Nafed
LinkedIn
This project is open-source and available under the MIT License.