Dsu Microproject
Dsu Microproject
Is Submitted by -
Miss. Gaikwad Pranjal Nilesh
Miss. Jadhav Shweta Pradip
Mr. Kochale Himesh Santosh
Mr. Shrike Aayush Ganapat
Under the guidance of
I would like to express my sincere thanks and gratitude to my guide Prof. Khopade
P.S for her commendable support and encouragement for the completion of Project with
perfection. I also convey my sincere thanks to Prof. Khutwad S.S for her invaluable
suggestions and for his technical support rendered during the course of my project.
I would like to thank all faculty members and staff of the Department of Computer
Engineering for their generous help in various ways for the guidance of this project.
This microproject involves the Introduction to Circular Queues: A circular queue, also known
as a “Ring Buffer,” takes the ordinary queue and adds a delightful twist: the last element is
connected back to the first, forming a graceful circle. Imagine a queue that wraps around like a
hula hoop, allowing elements to re-enter from the beginning. Here are the key points:
o When the queue becomes full, new elements wrap around to the beginning.
3. Implementation:
o Circular queues can be implemented using two primary data structures:
Array: Initialize an array of size n, where n represents the maximum
number of elements the queue can hold.
Linked List: Create a circular linked list.
o In the array-based implementation:
Initialize two pointers: front and rear.
Enqueue: Increment rear, wrap around if needed, and insert.
Dequeue: Increment front, wrap around if needed, and remove.
INTRODUCTION
Welcome to our Program of forming a circular queue, where we embark on a journey to unravel
the operations and implementation of circular queue using the powerful C programming
language. In this micro project, we aim to guide you through the creation of a sophisticated,
program that showcases the circular queue.
Prepare to dive deep into the forming of circular queue programming as we explore the
intricacies of circular queue. This hands-on experience will not only sharpen your skills in C
programming but also enhance your understanding of data structural concepts behind circular
queue.
Our circular queue program approach will empower you to build an interactive program capable
of handling various data structures and delivering accurate formations of data structures. From
user input validation to the implementation of structural algorithms, we'll cover it all, ensuring
you emerge from this program with a comprehensive skill set.
Join us on this exciting journey as we unlock the secrets of circular queue through the lens of C
programming. By the end of this micro project, you'll be equipped with the knowledge and
confidence to tackle complex data structures. Let's embark on this coding odyssey together and
transform formation of circular queue into an art .
CIRCULAR QUEUE DIAGRMATIC REPRESENTATION
APPLICATION OF CIRCULAR QUEUE
Memory Management:
o Circular queues optimize memory utilization by reusing vacated space.
o Unlike linear queues, where memory can be wasted due to fixed front and rear positions,
circular queues efficiently utilize available memory.
o In memory management systems, circular queues help manage memory allocation and
deallocation efficiently.
Process Scheduling:
o Operating systems use circular queues to manage processes in the CPU scheduler.
o Processes are enqueued and dequeued based on their priority or time slice, ensuring fair
execution.
Traffic Systems:
o Circular queues play a crucial role in computer-controlled traffic systems.
o They are used to switch traffic lights one by one repeatedly as per the predefined time
intervals.
o By cycling through the lights in a circular manner, traffic flow is managed efficiently
Real-Time Systems:
o In real-time systems (e.g., embedded systems, robotics), circular queues buffer sensor
data or control signals.
o Circular buffers ensure smooth data flow and prevent data loss.
o Networking Protocols:
o Circular queues are used for packet buffering and flow control in networking protocols.
o They help manage incoming and outgoing packets efficiently.
1.
NEED OF CIRCULAR QUEUE:-
Memory Utilization:
Efficient Buffering:
Resource Allocation:
Applications:
Memory Utilization:
Unlike linear queues, where memory can be wasted due to fixed front and rear positions,
circular queues efficiently utilize available memory.
Complex Implementation:
Properly managing the circular nature (e.g., incrementing front and rear pointers)
requires careful handling.
SOURCE CODE
##include <stdio.h>
if (front == -1) {
front = 0; // Set the front to the first position
}
}
return data;
}
// Main function
int main() {
enqueue(10);
enqueue(20);
enqueue(30);
display();
display();
return 0;
}
OUTPUT
Element 10 inserted
Element 20 inserted
Element 30 inserted
Queue elements: 10 20 30
Dequeued element: 10
Queue elements: 20 30
CONCLUSION
The microproject on the program in C for forming a circular queue has successfully demonstrated the
practical implementation through an intuitive user interface. Through careful design and efficient coding,
the project has achieved the following key outcomes:
Efficient space utilization: Circular queues are a type of queue that can be used to efficiently
use space. This is because the rear pointer can wrap around to the front of the queue when the
end of the array is reached. This prevents unused space from being left behind, unlike in a linear
queue.
Ring-like structure: Circular queues have a ring-like structure where the queue end is connected
to the queue start.
Queue operations: The queue operations in circular queues are similar to basic queues.
Implementation: Circular queues can be implemented using an array or a circular linked list.
Time complexity: The time complexity for each queue operation is O(1).
Uses: Circular queues can be used in areas such as operating systems, networking, and
scheduling systems.
In conclusion, the queue data structure is a linear type of data structure that is used to store the elements.
In this data structure elements are stored in the FIFO technique. A queue data structure used an array or
linked list during its implementation. The program for forming circular queue in C has successfully
combined practical functionality with user-friendly design. The project not only accomplishes its primary
goal of forming circular queue resolution but also serves as an educational resource for programming
enthusiasts. Future enhancements could explore additional data structure, optimization strategies, and
potential integration with other programming paradigms. Overall, this microproject serves as a solid
foundation for those seeking to understand and implement data structures through a program in C.
REFERENCES
Certainly! Here are some reference links that you can explore for your micro project on a
program in C for forming circular queue:
Simplilearn offers an overview of circular queues, their implementation using arrays, and
the core concepts behind them.
Reference link:- simplilearn.com/tutorials/data-structure-tutorial/circular-queue-in-data-
structure
PrepInsta provides a concise explanation of circular queues along with a C program for
array-based implementation.
Explore the tutorial
Reference link:-Circular Queue in C Programming | PrepInsta
Programiz covers circular queues, their representation, and basic operations. It includes
code snippets for better understanding.
Reference link:- Circular Queue Data Structure (programiz.com)
These references cover a range of topics, including C programming fundamentals, circular queue
program examples, and their operations in C. They should provide you with a solid foundation
and examples to guide you through the development of your micro project.