Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged Two Sorted Arrays Using Circular Queue #1749

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

DinkyRajpoot56
Copy link

Solved Issue No .#1719

Please Merged It..It is working properly..

Username: DinkyRajpoot56
Aim: Merged Two Sorted Arrays Using Circular Queue
Date: 8/11/2024

CircularQueue Struct: Contains the array, pointers for front and rear, and the capacity.
initializeQueue: Initializes the front and rear pointers to -1 to indicate an empty queue.
isFull and isEmpty: Utility functions to check if the queue is full or empty.
enqueue: Adds an element to the queue and updates the rear pointer.
dequeue: Removes an element from the queue and updates the front pointer.
mergeSortedArrays: Merges the two sorted arrays and enqueues elements in sorted order into the queue.
main: Initializes the arrays and calls the merge function, displaying the merged queue.
Key Points:
The queue size must be large enough to hold all elements from both arrays.
This code assumes no overflow handling beyond basic checks. For larger arrays, increase SIZE or use dynamic memory.
Screenshot (3645)

Screenshot (3646)
Screenshot (3647)
Screenshot (3648)
Screenshot (3649)

@pankaj-bind pankaj-bind merged commit 66d5d46 into AlgoGenesis:main Nov 8, 2024
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants